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/
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.
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.
I had this problem connecting to http://sdf.org through Mac OS X Lion. I changed under Terminal Preferences (⌘+,) > Advanced pane, Declare Terminal as to VT-100.
I also marked Delete Sends Ctrl-H because this Mac connection was confusing zsh.
It appears to be working for my use case.
edit your .bash_profile file
vim .bash_profile
commnet
#export TERM=xterm-256color
add this
export TERMINFO=/usr/share/terminfo
export TERM=xterm-basic
to your .bash_profile
finally
run:
source .bash_profile
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With