The problem is caused by there being no entry for the current $TERM under /usr/share/terminfo.
To fix the problem:
- Find out the current $TERM by
echo $TERM
- As a quick and dirty fix – maybe "good enough" – create a symlink in the appropriate subdirectory of /usr/share/terminfo to the file for a similar terminal. For example:
# echo $TERM
rxvt-unicode-256color
# cd /usr/share/terminfo/r/
/usr/share/terminfo/r# ls
[snip output which included rxvt-256color]
/usr/share/terminfo/r# ln -s rxvt-256color rxvt-unicode-256color
- For a proper fix, find a terminfo file for the current $TERM's terminal type. If it is not already compiled, the tic command can be used to compile it.