OS X Lion: Error opening terminal: xterm-256color

OS X Lion > Terminal.app > Error opening terminal: xterm-256color

I encountered this error when issuing the commands:

  • ssh
  • pico
  • nano

There might be other commands affected by this error.

A quick Google search shows that the problem lies within /usr/share/terminfo/ folder.  The answers that solved my problem is:

http://stackoverflow.com/questions/6804208/nano-error-error-opening-terminal-xterm-256color

and

https://discussions.apple.com/thread/3194454?start=0&tstart=0

I replaced the “terminfo” folder from OS X Lion installer but the problem persisted. So I downloaded it from the link provided in the Apple Discussions Board. It solved the problem.