2

From Ubuntu, I open gnome-terminal, and ssh to a OS X.

OS X version is:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.5
BuildVersion:   13F34

I have for example the file xterm-256color:

$ ls /usr/share/terminfo/78/xterm-256color
/usr/share/terminfo/78/xterm-256color

But I can't do a simple clear:

$ TERM='xterm-256color' clear
'xterm-256color': unknown terminal type.
user744629
  • 1,961
  • 1
  • 18
  • 27

2 Answers2

4

Your shell may set TERMINFO to some other location than /usr/share/terminfo, and confuse the ncurses library. The ncurses library has a compiled-in fallback value for TERMINFO, which can be overridden by setting the environment variable.

You may also have (from packages or the like, e.g., homebrew) a copy of clear in your path before /usr/bin/clear which points to an incomplete terminal database.

For the latter, "which clear" would show where that is the case. If you also have infocmp, the same information is available, e.g., in the first line of its output.

It is also possible to have a corrupted terminal database (why, I cannot say), and because the ncurses library makes some runtime checks on each entry, it could refuse to load those without apparent cause.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • `TERMINFO` was not set. `TERMINFO=/usr/share/terminfo TERM=xterm clear` works. Thanks! – user744629 May 22 '15 at 08:42
  • `TERM=xterm /usr/bin/clear` also works. I didn't noticed that I was running `/Users/froger/miniconda/bin/clear`, comming from https://binstar.org/asmeurer/ncurses. – user744629 May 22 '15 at 08:43
0

It works for me at OSX 10.10.3. I'm pretty sure it also worked on 10.9.x. I would say that something is wrong with that particular machine, but it is just a wild guess. Try xterm-color or plain xterm. Also, '' are not necessary there.

Nopik
  • 542
  • 1
  • 4
  • 15