1

(Note: this is similar to this question, but the answer there does not apply.)

Running under FreeBSD, I have ncurses installed via the usual pkg method for FreeBSD, but because I've seen some odd behaviour with a previously working curses program, I decided to download an ncurses source tarball from the official site and compile it under my home directory.

The compile went fine, but attempting to run any of the included test programs results in:

 Error opening terminal: xterm.

The documentation does say:

NOTE: You must have installed the terminfo database, or set the environment variable $TERMINFO to point to a SVr4-compatible terminfo database before running the test programs. Not all vendors' terminfo databases are SVr4-compatible, but most seem to be.

So it looks like the answer is to set TERMINFO, but to what? I don't see any terminfo database under the build directory itself, but I do have a file /usr/local/share/misc/terminfo.db installed as a result of the regular FreeBSD installation.

Nevertheless, setting (csh syntax) setenv TERMINFO /usr/local/share/misc/terminfo.db (or the same omitting the .db extension) doesn't make any difference.

(Note: this shouldn't matter because I haven't so far attempted to install the local build, but when I ran "configure", I used: ./configure --prefix=$HOME so that it would install under my home directory.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
varro
  • 2,382
  • 2
  • 16
  • 24

1 Answers1

2

By default, ncurses uses (reads/writes) a directory-tree of terminal descriptions. Optionally (and seen in the makefile for the ncurses port), it reads/writes a hashed database file, as well as reads the directory-tree.

The INSTALL file in the ncurses sources goes into some detail about the --with-hashed-db configure option, which you apparently overlooked. The term(5) manual page gives a better overview.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • I did indeed overlook that in the INSTALL file, and reconfiguring with the `--with-hashed-db` option does the trick. I am curious, though, isn't terminfo installed as part of ncurses? And if that's the case, does that mean one can't run the tests after building ncurses without installing first? Or do I misunderstand? In any case, I'm back on track now, so thank you for your answer, – varro May 23 '18 at 20:47
  • If you installed ncurses (rather than running it from your home-directory), the terminfo database is part of that - but the hashed database uses a different interface than the default. – Thomas Dickey May 23 '18 at 20:52
  • I was able to use `misc/terminfo.src` (and also `misc/terminfo.src.db`, not sure what the difference is) from the source distribution (ncurses 6.3) as `TERMINFO` when configured with `--with-hashed-db`. – corwin.amber Nov 22 '22 at 11:13