MacBook-Pro:~ user$ clear
terminals database is inaccessible
Now, if you go looking at forums, a lot of them are going to say something like "check your TERM" or "try removing your dot files temporarily", or some such. That's misdirection, based on someone hacking together a Linux environment. This is OSX, and I haven't been hacking my environment recently.
Seems that either the Lion upgrade or Xcode 4 screwed something up. An Ubuntu posting on Stack Overflow discusses the cause of the problem, a missing terminfo file (/usr/share/terminfo/78/xterm-256color). I go into Time Machine to investigate, and lo and behold, there is no /usr.
Mac OSX apparently hides UNIX files. Where's the UI setting for that? Um, well, the folks at Apple decided that magically hiding files should be managed by a magical switch:
MacBook-Pro:~ user$ defaults write com.apple.finder AppleShowAllFiles True
MacBook-Pro:~ user$ killall Finder
(Really, Apple? Why is there no UI? The man page detritus has no indication of what the actual settings are. So much for UI discoverability, but at least some of the info is documented, and thanks to Google and places like Stack Overflow it can be found.)
I go to restore the file, finding it a couple of weeks back. Unfortunately, Time Machine still won't show UNIX directories in its file browser. The original location (/usr/share/terminfo/78) isn't visible as an option. I copy it manually. Stupid.Magical.Finder.
Note to the person on the Xcode 4 team that decided to do the cleaning up: multiply the time wasted that by all the developers you tripped up, and your one mistake probably comes out to hundreds of hours, not to mention the systems that now have crippled terminfo files.