Nano error: Error opening terminal: xterm-256color

After installing OSX Lion, I tried:

nano /etc/apt/sources.list 

But I get this error:

 Error opening terminal: xterm-256color 

If I try to switch terminal.app settings to open terminal windows in "xterm color" instead of xterm-256color , everything works fine.

What's happening?

+81
terminal nano
Jul 24 2018-11-11T00:
source share
11 answers

On Red Hat, this worked for me:

 export TERM=xterm 

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

+114
Jul 09 '14 at 22:34
source share

After upgrading to OSX Lion, I started getting this error on specific servers (Debian / Ubuntu). 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 through Eric Osterman .

+27
Jul 26 '11 at 3:20
source share

I can confirm that this is a terminfo problem. This is what worked for me. Ssh to the remote machine and run

  sudo apt-get install ncurses-term 

Boom. The problem is resolved.

+16
Feb 10 '14 at 19:55
source share

I also have this problem on an older Mac, which I upgraded to Lion.

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

After reading the hint, I grabbed /usr/share/terminfo from a newer Mac that has a new Lion installation and does not detect this problem.

Now, although echo $TERM still gives xterm-256color , now vi and less are working fine.

+6
Jul 24 '11 at 16:39
source share

I had this issue related to http://sdf.org through Mac OS X Lion. I changed under Terminal Preferences ( โŒ˜ + , ) > Advanced panel, Declare Terminal as to VT-100 .

I also noted Delete Sends Ctrl-H because this Mac connection was confusing zsh .

It seems to work for my use.

+5
Feb 13
source share

and sometimes the terminfo folder gets corrupted after a new installation. I do not know why, but the problem can be solved in this way:

 1. Download Lion Installer from the App Store 2. Download unpkg: http://www.macupdate.com/app/mac/16357/unpkg 3. Open Lion Installer app in Finder (Right click -> Show Package Contents) 4. Open InstallESD.dmg (under SharedSupport) 5. Unpack BSD.pkg with unpkg (Located under Packages) Term info will be located in the new BSD folder in /usr/share/terminfo 

hope this helps.

+3
Jul 24 '11 at 1:21
source share

I heard that this can be fixed by overwriting your /usr/share/terminfo one of the computers of someone with a working Lion installation. I canโ€™t confirm whether this works or not, and, unfortunately, Iโ€™m not yet updated, so I canโ€™t provide you this file.

0
Jul 24 2018-11-11T00:
source share

You can add the following to your .bashrc

 if [ "$TERM" = xterm ]; then TERM=xterm-256color; fi 
0
Mar 10 '15 at 21:20
source share
  • edit the .bash_profile file

    vim .bash_profile

  • CommNet

    #export TERM=xterm-256color

  • add this

    export TERMINFO=/usr/share/terminfo

    export TERM=xterm-basic

    at .bash_profile

  • finally,

    mileage:

    source .bash_profile

0
Sep 18 '17 at 19:55 on
source share

Mine was a rather unique case, but it could help someone. On Android, I tried to copy nano from my binary termux folder to / system / xbin. I put all the library dependencies in / system / lib and got this error. The libncurses.so.6 file that I copied from termux had a TERMINFO file that still pointed to /data/data/com.termux/files/usr/share/terminfo

View the index path using the command

lines path-to-libncurses.so | grep / terminfo

To fix either make termux terminfo dir and subdirs readable and executed by nano, or copy the terminfo folder to another location and use hexeditor to change the plain text path in the shared library file.

Link to the zipped terminfo folder https://drive.google.com/file/d/1m1tfHgkGRehBGh1jPMK4EaTgQb9EyCG7/view?usp=drivesdk

0
Nov 02 '18 at 15:02
source share

sudo apt-get install ncurses-term

Thanks for working fine on ubuntu, I installed the package as suggested. I logged out, then returned from OS X, and I had good colors with Vim. Cleaning works as expected. thanks again

0
Dec 04 '18 at 7:59
source share



All Articles