nano error: Error opening terminal: xterm-256color

前端 未结 10 561
梦谈多话
梦谈多话 2020-12-22 17:41

After the installation of OSX Lion, I tried to:

nano /etc/apt/sources.list

But I get this error:

Error opening terminal: xt         


        
相关标签:
10条回答
  • 2020-12-22 18:20

    I hear that this can be fixed by overwriting your /usr/share/terminfo with one from the computer of somebody with a working install of Lion. I can't confirm whether this works or not, and unfortunately I haven't upgraded yet, so I can't provide you with that file.

    0 讨论(0)
  • 2020-12-22 18:23

    You can add the following in your .bashrc

    if [ "$TERM" = xterm ]; then TERM=xterm-256color; fi
    
    0 讨论(0)
  • 2020-12-22 18:24

    After upgrading to OSX Lion, I started getting this error on certain (Debian/Ubuntu) servers. The fix is simply to install the “ncurses-term” package which provides the file /usr/share/terminfo/x/xterm-256color.

    This worked for me on a Ubuntu server, via Erik Osterman.

    0 讨论(0)
  • 2020-12-22 18:25

    I, too, have this problem on an older Mac that I upgraded to Lion.

    Before reading the terminfo tip, I was able to get vi and less working by doing "export TERM=xterm".

    After reading the tip, I grabbed /usr/share/terminfo from a newer Mac that has fresh install of Lion and does not exhibit this problem.

    Now, even though echo $TERM still yields xterm-256color, vi and less now work fine.

    0 讨论(0)
  • 2020-12-22 18:26

    On Red Hat this worked for me:

    export TERM=xterm
    

    further info here: http://www.cloudfarm.it/fix-error-opening-terminal-xterm-256color-unknown-terminal-type/

    0 讨论(0)
  • 2020-12-22 18:29

    I can confirm this is a terminfo issue. This is what worked for me. SSH in to the remote machine and run

     sudo apt-get install ncurses-term
    

    Boom. Problem solved.

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