NetBSD — Unix — multimedia — other fun

Maintaining a private Terminfo database

— Saturday, July 06, 2013

So I just installed the st(1) terminal emulator, but I didn't bother with the Terminfo entry it ships with. For some reason I was kind of allergic to the idea of modifying /usr/share/misc/terminfo. I felt like I could wipe something out entirely...

Well it turns out you don't ever need to touch /usr/share/misc/terminfo. On NetBSD at least, you can maintain a private terminfo database in your home directory. Here's what I did to get st(1)'s terminfo working without touching /usr/share/misc/terminfo:

  1. st(1) is the only terminal emulator I use which needs its own terminfo entry that does not ship with the system, so I just copied the file from st(1)'s tarball to ~/.terminfo (that's a file, not a directory).

  2. Run tic(1) over it: $ tic ~/.terminfo

  3. This generates a cdb(5) database to ~/.terminfo.cdb. That's a feature specific to NetBSD.

  4. In my .bashrc I added this:

    export TERM=st

  5. Restart st(1).

Done! Now tmux's split windows actually look good. And my DEL and DELETE keys behave! (Edit: I swear my forward delete worked, now it doesn't??)

And if I ever needed to add another terminfo entry then I would append it to ~/.terminfo and run tic(1) again.

Post a Comment