Fixing a caveat with my terminfo on OpenBSD

· Snippets from the Ether

When terminfo doesn't quite work on OpenBSD when installing with tic

Using ghostty to access OpenBSD remotely #

I'm using ghostty as my primary terminal on MacOS, and the helpful Terminfo page shows how to easily copy the ghostty terminfo entry to the remote machine.

infocmp -x xterm-ghostty | ssh YOUR-SERVER -- tic -x -

However, it lists a caveat - and I ran across an edge case that I wasn't expecting.

tic will normally place its results in the system database, /usr/share/terminfo. This location can be overridden with the TERMINFO environment variable. If TERMINFO is not set and tic cannot write to the system location, it will place the results in $HOME/.terminfo if it exists. man tic for details.

My edge case: pkg_add on OpenBSD does not consider the user's terminfo, and gives a warning like this:

No progress meter: failed termcap lookup on xterm-ghostty

Not a show-stopper, just annoying. After some searching, I thought about the caveat and decided to try manually copying the file to the system database, remembering that it's important to set the permissions to match the other files in the folder.

doas cp $HOME/.terminfo/x/xterm-ghostty /usr/share/terminfo/x/xterm-ghostty

doas chmod 444 /usr/share/terminfo/x/xterm-ghostty

Now I get the progress meter as normal using pkg_add (and presumably some other system commands). I'll have to keep an eye on it, because at some point an os upgrade may reset that folder to the official list of files, so I'm keeping this here so that I remember what I did...

last updated: