-
Notifications
You must be signed in to change notification settings - Fork 5
terminfo
Terminfo is a library and database that enables programs to use display terminals in a device-independent manner.
In layman's terms, your terminal emulator uses terminfo
to diaplay CLI, or talk to tmux/Vim so they can display the text based interface.
Currently, Thomas E. Dickey maintains ncurses
and the distributed terminfo
database. Here are links to a table of content of terminfo
database, a terminfo
database, and a coloured terminfo
database.
In this wiki page, all terminfo
are compiled with this database with no alteration.
To get terminfo
database:
$ curl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz && gunzip terminfo.src.gz
The file is downloaded as a terminfo.src
file. It includes basically all existent terminfo
.
To see xterm-256color
terminfo:
$ infocmp -x xterm-256color
The option -x
includes user-defined capabilities which begins with capital letter (e.g. curly underline Smulx
).
To compile database into ~/.terminfo
:
$ tic -x terminfo.src
All the terminfo
defined in terminfo.src
will be compiled. Similar to infocmp
, the option -x
includes user-defined capabilities.
To compile only to one or some terminfo
, into ~/.terminfo
:
$ tic -xe xterm-256color,tmux-256color terminfo.src
Only xterm-256color
and tmux-256color
are compiled.
To compile for all users (into e.g. /usr/share/terminfo
):
$ sudo tic -x terminfo.src
-
Italics,
sitm=\E[3m
entry. It's not inxterm-256color
, but terminal emulators like iTerm2 enables italics in their software. It's intmux-256color
, but for iTerm2, this line needs to be added intotmux.conf
:set -as terminal-overrides ',*:sitm=\E[3m'
-
Curly underline,
Smulx=\E[4\:%p1%dm
entry, see https://github.com/tmux/tmux/issues/1492#issuecomment-427939241. This is a user-defined capability, and needs to be enabled by terminal emulators first. kitty and iTerm2 implemented curly underline. kitty has its own terminfoxterm-kitty
which includes curly underline entry.tmux-256color
also has it. But it's not available inxterm-256color
. Therefore, kitty can show curly underline withxterm-kitty
but iTerm2 cannot show curly underline withxterm-256color
, but both can display curly underline in tmux withtmux-256color
, provided this line is added intotmux.conf
:set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
-
Coloured underline,
Setulc=\E[38\:2\:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d%;m
entry, see https://github.com/tmux/tmux/pull/1771#issuecomment-500906522. I'm not sure if it exists in whichterminfo
, but for tmux at least add this line intotmux.conf
:set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
Ref: