0

I'm building ncurses 6.1 from source for some reasons. First I configure the sources with

./configure

and then I build it with

make

both without arguments. When I try to run tests I get the error message

Error opening terminal: xterm-256color.

on my local system (Ubuntu 17.10) and

Error opening terminal: xterm

on the build server (Jenkins Docker container).

I found out that this build is looking for terminal descriptions in /usr/share/terminfo/. There are many descriptions but no xterm-256color on my local system. On the build server the folder /usr/share/terminfo/ is empty. I found xterm-256color and xterm at /lib/terminfo. When I install ncurses with package manager (apt for Ubuntu 17.10), it works. So I assume that this package chooses the right path. I copied xterm-256color resp. xterm from /lib/terminfo to /usr/share/terminfo/ and my build works on both systems now. Why do two different paths exist and why do these two versions of ncurses choose two different paths? I need a conan package of ncurses that works out of the box without copying description files.

This could be a duplicate of: How to set custom search paths for the terminfo database when building ncurses from source

Thomas Sablik
  • 15,040
  • 7
  • 26
  • 51

1 Answers1

2

The answer is in the summary at the end of configure (which isn't shown in the question). But running infocmp -D will show the directories that infocmp would use when looking for descriptions.

You can modify the behavior using the TERMINFO and TERMINFO_DIRS environment variables.

The /lib/terminfo is Debian-specific (Ubuntu doesn't provide any changes for ncurses; they simply recompile the Debian packages: most Ubuntu bug reports for ncurses deal with their problems in doing that).

Debian by default installs someone's notion of a minimal terminal database in that directory. Install ncurses-term to get a full terminal database.

By the way, compiling and installing ncurses on Debian/Ubuntu/other systems with ncurses already installed runs a risk of breaking the existing libraries which are used (for example) by bash and other utilities that you probably need.

Thomas Dickey
  • 43,185
  • 7
  • 51
  • 88
  • Is it possible to change the behavior in with arguments to `configure` or `make`. As I said I want to use the library without changing the systems, no environment variables or copying of descriptions. I'm not installing my own build. I use conan, so the library is in the jenkins home an conan sets the include and library paths. – Thomas Sablik Mar 03 '18 at 21:16
  • `./configure --datadir=/lib` and `make` works for me. Your information lead to the correct post in SO. – Thomas Sablik Mar 03 '18 at 21:23