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

后端 未结 12 1861
爱一瞬间的悲伤
爱一瞬间的悲伤 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:40

    You probably need to install a package on your Linux host which provides one of the following files:

    /usr/share/terminfo/x/xterm-256color
    /lib/terminfo/x/xterm-256color
    

    On Ubuntu, for example, this is provided by the ncurses-base package.

    0 讨论(0)
  • 2020-12-24 01:40

    In the question, the user's configuration asked for a terminal description which was not the default screen. This was eventually fixed by an update from Apple. In the version cited in the question, Apple did not provide that terminal description. They do now (and have since 2015). For the record, here is a directory listing showing the related entries for MacPorts (in /opt/local), a locally built ncurses (in /usr/local) and the Apple/system files in /usr/share:

    -rw-r--r--   1 root         1912 Oct  3 2015    opt/local/share/terminfo/73/screen-256color
    -rw-r--r--   1 root         1924 Oct  3 2015    opt/local/share/terminfo/73/screen-256color-bce
    -rw-r--r--   1 root         1954 Oct  3 2015    opt/local/share/terminfo/73/screen-256color-bce-s
    -rw-r--r--   1 root         1940 Oct  3 2015    opt/local/share/terminfo/73/screen-256color-s
    -rw-r--r--   1 root         1912 Apr 12 04:22   usr/local/ncurses/share/terminfo/73/screen-256color
    -rw-r--r--   1 root         1924 Apr 12 04:22   usr/local/ncurses/share/terminfo/73/screen-256color-bce
    -rw-r--r--   1 root         1954 Apr 12 04:22   usr/local/ncurses/share/terminfo/73/screen-256color-bce-s  
    -rw-r--r--   1 root         1940 Apr 12 04:22   usr/local/ncurses/share/terminfo/73/screen-256color-s
    -rw-r--r--   1 root         1828 Aug 22 2015    usr/share/terminfo/73/screen-256color
    -rw-r--r--   1 root         1840 Aug 22 2015    usr/share/terminfo/73/screen-256color-bce
    -rw-r--r--   1 root         1866 Aug 22 2015    usr/share/terminfo/73/screen-256color-bce-s
    -rw-r--r--   1 root         1856 Aug 22 2015    usr/share/terminfo/73/screen-256color-s
    

    You may notice a few details:

    • on OSX, the default file-system ignores case, so the s is encoded in hexadecimal (to make it distinct from S)

    • the entries have slightly different sizes. Apple provided an older version of the terminal database, which lacks some features.

    • Using toe, I see this:

        --> /usr/local/ncurses/share/terminfo
        ----> /usr/share/terminfo
        ------> /opt/local/share/terminfo
        *-*-*-: screen-256color GNU Screen with 256 colors   
        *-*-*-: screen-256color-bce     GNU Screen with 256 colors and BCE 
        *-*-*-: screen-256color-bce-s   GNU Screen with 256 colors using BCE and status line
        *-*-*-: screen-256color-s       GNU Screen with 256 colors and status line
    

    and comparing the system versus MacPorts:

    --- macports    2017-04-26 04:38:21.000000000 -0400
    +++ system      2017-04-26 04:40:08.000000000 -0400
    @@ -1,19 +1,19 @@
    -#      Reconstructed via infocmp from file: /opt/local/share/terminfo/73/screen-256color
    +#      Reconstructed via infocmp from file: /usr/share/terminfo/73/screen-256color
     screen-256color|GNU Screen with 256 colors,
            am, km, mir, msgr, xenl,
    -       colors#256, cols#80, it#8, lines#24, pairs#32767,
    +       colors#256, cols#80, it#8, lines#24, ncv#3, pairs#32767,
            acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
            bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
            clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M,
            csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
            cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
            cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM,
    -       cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
    -       dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
    -       enacs=\E(B\E)0, flash=\Eg, home=\E[H, ht=^I, hts=\EH,
    -       ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0,
    -       kbs=^H, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
    -       kcuu1=\EOA, kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~,
    +       cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
    +       dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0,
    +       flash=\Eg, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@,
    +       il=\E[%p1%dL, il1=\E[L, ind=^J, initc@, is2=\E)0, kbs=^H,
    +       kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
    +       kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~,
            kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
            kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
            khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
    @@ -22,6 +22,6 @@
            rmul=\E[24m, rs2=\Ec\E[?1000l\E[?25h, sc=\E7,
            setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
            setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
    -       sgr=\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;m%?%p9%t\016%e\017%;,
    +       sgr=\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
            sgr0=\E[m\017, smacs=^N, smcup=\E[?1049h, smir=\E[4h,
            smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g,
    
    0 讨论(0)
  • 2020-12-24 01:43

    You can install ncurses-term on the remote server (Debian/Ubuntu) to fix the issue.

    0 讨论(0)
  • 2020-12-24 01:45

    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
    
    0 讨论(0)
  • 2020-12-24 01:45

    You just need to copy /usr/share/terminfo/x/xterm-256color to the server that you're connecting to.

    0 讨论(0)
  • 2020-12-24 01:50

    Don't forget to refresh terminal source if you export a variable...

    source ~/.bashrc or just open a new terminal. May be why original poster had trouble with exporting.

    0 讨论(0)
提交回复
热议问题