The terminfo entry for “xterm-256color
” that ships by default as part of ncurses-base on Debian Linux and its derivatives is a bit annoying. In particular, shifted up-arrow key presses work fine in some programs, but fail in others. It’s a bit of a gamble if Shift-Up
works in joe, pico, vim, emacs, mutt, slrn, or what have you.
THis afternoon I got bored enough of losing my selected region in Emacs, because I forgot that I was typing in a terminal launched by a Linux desktop. SO I thought “what the heck… let’s give the FreeBSD termcap entry for xterm-256color a try”:
keramida> scp bsd:/etc/termcap /tmp/termcap-bsd keramida> captoinfo -e $( \ echo $( grep '^xterm' termcap | sed -e 's/[:|].*//' ) | \ sed -e 's/ /,/g' \ ) /tmp/termcap > /tmp/terminfo.src keramida> tic /tmp/terminfo.src
Restarted my terminal, and quite unsurprisingly, the problem of Shift-Up
keys was gone.
The broken xterm-256color
terminfo entry from /lib/terminfo/x/xterm-256color
is now shadowed by ~/.terminfo/x/xterm-256color
, and I can happily keep typing without having to worry about losing mental state because of this annoying little misfeature of Linux terminfo entries.
The official terminfo database sources[1], also work fine. So now I think some extra digging is required to see what ncurses-base ships with. There’s definitely something broken in the terminfo entry of ncurses-base, but it will be nice to know which terminal capabilities the Linux package botched.
Notes:
[1] http://invisible-island.net/ncurses/ncurses.faq.html#which_terminfo