When I run
screen
on the remote host(running Linux), I obtain the following error:
Cannot find terminfo entry for 'xterm-256color'.
I am running terminal on Mac OSX Lion to access the remote host. I have googled to find out the solution to this problem and it appears that people suggest doing
export TERM=xterm-color
which doesn't work for me.
Please help.
xterm-256color describes Xterm with support for 256 colors enabled. xterm-color describes an older branch of Xterm that supports eight colors. xterm-color is not recommended, since it describes a variant of Xterm that's less functional and that you're not likely to be using.
Terminfo is a library and database that enables programs to use display terminals in a device-independent manner.
Find out which TERM is supported:
ls /usr/share/terminfo/x
this will give you a list of supported TERMs i.e.
xterm
xterm-xfree86
set the environment variable:
export TERM=xterm-xfree86
and run screen:
TERMINFO='/usr/share/terminfo/' screen
In the terminal app you are using to ssh, go to preferences -> advanced -> Declare terminal as: -> xterm-color (or something besides xterm-256color)
This answer was taken from a comment to this post, which has another solution: http://marcoschuh.de/wp/?p=873
In case of my Buffalo Linkstation I solved it this way:
cd /lib/terminfo/x
ln -s xterm-color xterm-256color
You're missing a terminfo
file on the remote machine which matches 'xterm-256color'.
Screen doesn't know how to emulate the terminal you've asked for (xterm-256color) because it doesn't have the file which describes the terminal you're using (xterm-256color).
You could change the ENV variable TERM
to ask for a terminal emulation which the remote machine does have. For example: export TERM=vt220
, but that would assume your remote has a vt220 terminfo file, and you wouldn't get pretty colors, and you'd have to do other tedious things to make it stick. Better...
If your local machine has terminfo files but your remote machine doesn't, for example, a linux/macos talking to a QNAP/QNAS/busybox/rpi/router/modem/IOTdevice then...
You can copy the necessary file over to it and instruct your remote terminal to use it for screen. eg:
[local] $ scp /lib/terminfo/x/xterm-256color john@nasbox:xterm-256color
[local] $ ssh john@nasbox
[remote] $ ls
xterm-256color
[remote] $ TERMINFO='/share/homes/john/xterm-256color' screen
Screen should work at this point. Your local machine might have the terminfo
directory someplace else (/etc/terminfo/
and /usr/share/terminfo/
are common alternatives; you might have to dig around to find yours).
To set it up more permanently move it to a '.terminfo' directory in your home directory (or elsewhere if you know better). eg:
[remote] mkdir -p .terminfo/x
[remote] mv xterm-256color .terminfo/x
[nasbox] screen
The same technique should apply to other terminal emulations. The ENV variable TERM
determines which terminal it should try to emulate and the file of the same name provides the magic codes to make it all happen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With