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

后端 未结 12 1976
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 00:51

When I run

screen

on the remote host(running Linux), I obtain the following error:

Cannot find terminfo entry for \'xterm-         


        
12条回答
  •  星月不相逢
    2020-12-24 01:38

    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.

提交回复
热议问题