Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

UPDATE 3 - Better Solution

I kept Google'ing this until I came to a different solution. I ended up downloading the terminfo directory from somewhere (I forgot where so I just posted the zip on my website here) and replaced my current working terminfo directory with the new stuff.

The terminfo directory, for me, is located at...



bahamat helped me get to the solution. I added the following to my .profile...

export TERM

... and I am still able to keep "xterm-256color".


I figured out why this is happening. At one point, I changed some settings...

enter image description here

The default is "xterm-color" and I changed it to "xterm-256color". Is there a reason for this to be happening?

I just set up a second admin user account on a fresh install of Mac OS X Lion and now when I try to clear the terminal, I get the following error...

Hristo $ clear
terminals database is inaccessible

This is a problem for both user accounts and I have no idea why. I'm not sure if this is much help, but here is what $TERM is set to...

Hristo $ echo $TERM

Any thoughts as to why this might be happening?

Let me know if I need to show my .bashrc or .profile.

share|improve this question
up vote 3 down vote accepted

Looks like your TERM value isn't recognized. You are probably setting the TERM value in your .profile (or similar) or you've got missing/corrupt files or invalid permissions in /usr/share/terminfo/.

share|improve this answer
hmm... I am not setting the TERM value in neither account's .profile and the permissions are 755 for all directories under /usr/share/terminfo/ with owners root wheel – Hristo Aug 6 '11 at 22:41
Run echo $TERM and tell me what it says. – bahamat Aug 6 '11 at 22:57
@bahamat... that is in my post above. it says "xterm-256color" – Hristo Aug 6 '11 at 22:58
Sorry, don't know why I missed that. Look at /usr/share/terminfo/78/xterm-256color. Does it exist? Is it readable by you? Try changing your TERM to xterm and see if the problem persists. – bahamat Aug 6 '11 at 23:03
xterm-256color does not exist and how would I change TERM to xterm? – Hristo Aug 6 '11 at 23:15

In Mac OS X Lion 1.07, Terminal now supports 256 colors, Background Color Erase (BCE) and some other features that make it more compatible with modern xterm, and the default value for $TERM is now xterm-256color instead of xterm-color (which represents an older branch of xterm with less functionality).

If you upgrade to Lion, any settings profiles that used xterm-color will use the new default. (All "Declare terminal as" does is set the value of $TERM, by the way.)

The error you're seeing indicates that the appropriate terminfo files for xterm-256color are either missing or inaccessible. You might try installing Lion again. Also, some people have reported that installing Xcode 4 on Lion can cause this problem.

You can test the validity of xterm-256color with the following shell command:

infocmp xterm-256color

This will either display an error or the appropriate terminfo values for xterm-256color, and, if found, it displays the pathname to the terminfo file it used.

share|improve this answer
running $ infocmp xterm-256color results in infocmp: couldn't open terminfo file (null). So I'm assuming something is wrong. I did install Xcode 4 but can't definitively say that it was the reason. Any suggestions? I would prefer not to reinstall Lion... – Hristo Aug 11 '11 at 7:44
... seems to work now... no idea what changed – Hristo Aug 11 '11 at 7:48
I'm missing the profile for xterm-256color under /usr/share/terminfo/78 as well. For now setting the default terminal back to xterm-color. – Ari Braginsky Oct 7 '11 at 19:06
Using xterm-color is not recommended, as it describes an older, less capable branch of Xterm. If xterm-256color isn't installed, the next best $TERM values to try are xterm-88color, xterm-16color and xterm, in that order. – Chris Page Oct 10 '11 at 8:36
Terminal's "Declare terminal as" preference setting only contains xterm, xterm-color and xterm-256color. However, you can set it to other values by editing preferences with defaults write … or by editing the preferences file. Or, you can change the value of TERM in your shell startup file, e.g., put export TERM=xterm-88color in ~/.bashrc (and if you haven't already done this, create a ~/.bash_profile that runs ~/.bashrc). – Chris Page Oct 10 '11 at 8:50

xterm-256color should be present in /usr/share/terminfo/78.

Run this command and double check if it's there:

ls -laR /usr/share/terminfo

In the past, there were issues with Xcode messing up permissions to a huge degree. Worst case scenario, use disk utility and repair your permissions. You will need to boot from an install DVD and verify/repair your boot partition.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .