3 ms·
"This has a multitude of problems, however. The terminfo database is part of the ncurses library, and different operating systems and distributions package diff
by 1vuio0pswjnm7 3y ago
"This has a multitude of problems, however. The terminfo database is part of the ncurses library, and different operating systems and distributions package different versions of ncurses. This was a problem for tmux users on macOS for many years because the version of ncurses packaged with macOS was so old that it did not even include the tmux-256color terminfo entry at all!"
I build static Linux userlands from scratch using only busybox/toybox and a statically-linked GCC.
When compiling programs, e.g., tmux, I have been using netbsd-curses instead of ncurses.
After I compile tmux statically, the terminfo entries needed by tmux, i.e., needed by the curses libraries compiled into it, are contained by default in the directory $HOME/.terminfo. If nothing is found there, tmux then checks /usr/share/terminfo (or whatever path was use when compiling, e.g., /usr/local/share/terminfo).
This directory can of course exist apart from a curses library installed in a directory. In the userlands I make, there is no curses library installed in a directory after I have finished compiling all the programs.
For example, I can make a tarball of the terminfo directory from any suitable up-to-date distribution and untar it on the target computer.
Or I can make a hashed database of only the entries I need.
For me, the terminfo database is not "part of the curses library"; curses libraries provide an example terminfo database and a utility to compile terminfo entries. If the entries were truly part of the library, then one might argue they would be compiled into programs along with the library when compiling statically.
I keep a personalised copy of a terminfo database, i.e., a tarball of a terminfo directory, separate and apart from a curses library.
To be used with whatever curses library I choose. Not to suggest there is a great variety of curses libraries to choose from.
- 1vuio0pswjnm7 2y agoNetBSD curses actually does compile a few terminal descriptions into the library https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libterminfo/genterms https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/lib... ansi dumb vt100 vt220 wsvt25 xterm Unfortunately, netbsd-curses for Linux removed vt220 while almost tripling the size of the list I prefer vt220 am not interested in 256 colors https://raw.githubusercontent.com/sabotage-linux/netbsd-curses/master/libterminfo/genterms https://raw.githubusercontent.com/sabotage-linux/netbsd-curs... xterm linux xterm-256color ansi dumb vt100 screen screen-256color tmux-256color rxvt-unicode rxvt-unicode-256color st-256color dvtm dvtm-256color fbpad-256