setupterm doesn't find terminfo entry in non-standard database location

Bug #1786617 reported by Xandor Schiefer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ncurses (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

My terminal emulator (Kitty) installs its terminfo entry to:

/usr/local/lib/kitty/terminfo/x/xterm-kitty

But it also registers /usr/local/lib/kitty/terminfo/ as a terminfo database:

% infocmp -D
/usr/local/lib/kitty/terminfo
/etc/terminfo
/lib/terminfo
/usr/share/terminfo

I use tmux, which uses setupterm: https://github.com/tmux/tmux/blob/b2a2c3a1e90756313b6709905f189934123f85ed/tty-term.c#L412

setupterm sets an error code unless I symlink the terminfo def to a traditional location:

sudo ln -s /usr/local/lib/kitty/terminfo/x/xterm-kitty /usr/share/terminfo/x/xterm-kitty

This stops the problem. setupterm is presumably not searching all database locations.

I am not the developer of tmux, he directed me here to log the issue.

See https://github.com/tmux/tmux/issues/1433 for the original bug report.

Revision history for this message
Thomas Dickey (dickey-his) wrote :

Looking at kitty's source, it appears that
kitty's install copies a compiled binary terminfo
rather than using the tic utility.
As such, it's not an ncurses bug.

Changed in ncurses (Ubuntu):
status: New → Invalid
Revision history for this message
Kovid Goyal (kovid) wrote :

No, kitty uses the tic utility to compile its terminfo file when building the kitty package.

https://github.com/kovidgoyal/kitty/blob/master/setup.py#L601

Changed in ncurses (Ubuntu):
status: Invalid → New
Revision history for this message
Kovid Goyal (kovid) wrote :

Not to mention that if symlinking the compiled terminfo into /usr/share/terminfo fixes the problem, then the problem cannot be in the format of the compiled database.

Revision history for this message
Kovid Goyal (kovid) wrote :

Oh and reading the original bug report posted against tmux, this problem is most likely caused because the OP is running tmux in client server mode and the server runs in an environment different from the client (at machine startup). infocmp can find the kitty terminfo because kitty sets the TERMINFO env var to point to its terminfo deifnition file. That env var is likely not present in the environment in which the tmux server is started.

So the fix is to either copy the kitty terminfo files to /usr/share/terminfo or to set TERMINFO in whatever script is used to start the tmux server.

Revision history for this message
Thomas Dickey (dickey-his) wrote :

either way: not a bug in ncurses

Changed in ncurses (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.