Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen: Cannot find terminfo entry for 'xterm-256color'

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.

like image 345
Vinayak Agarwal Avatar asked Sep 10 '12 05:09

Vinayak Agarwal


People also ask

What is xterm 256color?

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.

What is terminfo in Linux?

Terminfo is a library and database that enables programs to use display terminals in a device-independent manner.


4 Answers

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
like image 61
BigSN Avatar answered Oct 01 '22 05:10

BigSN


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

like image 32
bennlich Avatar answered Oct 01 '22 06:10

bennlich


In case of my Buffalo Linkstation I solved it this way:

cd /lib/terminfo/x
ln -s xterm-color xterm-256color
like image 10
Jürgen Jatzkowski Avatar answered Oct 01 '22 04:10

Jürgen Jatzkowski


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.

like image 7
John Mee Avatar answered Oct 01 '22 05:10

John Mee