tput is a program in the ncurses package that outputs terminal control codes. these codes differ from terminal to terminal and are maintained in a terminfo database (see man terminfo, /usr/share/terminfo). tput vi is supposed to turn the cursor invisible. /usr/bin/tput vi does this for me in Terminal.app, but the tput compiled by Gentoo Prefix does not:
$ tput vi
tput: unknown terminfo capability 'vi'
TERM is set to xterm-new because that appears to be the closest TERM entry corresponding to Terminal's capabilities.
The problem arises because of a difference in terminfo data in these files:
/Gentoo/usr/share/terminfo/s/screen.xterm-new -> ../s/screen.xterm-xfree86
They contain different data. They are compiled by ncurses. Unfurtunately I know very little of how these databases are constructed.
Hmm, it seems that terminfo is pretty screwed up in prefix. I'm on x86-linux and this is interesting:
% type -p tic
% tic $EPREFIX/usr/share/terminfo/x/xterm
"/home/jolexa/portage/linux-32/usr/share/terminfo/x/xterm", line 1, col 1: Illegal character (expected alphanumeric or @%&*!#) - '^Z'
Adding myself to CC so I can see if there is a solution down the road. Let me know if you need anything else.
(In reply to comment #2)
> Hmm, it seems that terminfo is pretty screwed up in prefix. I'm on x86-linux
> and this is interesting:
> % type -p tic
> % tic $EPREFIX/usr/share/terminfo/x/xterm
> "/home/jolexa/portage/linux-32/usr/share/terminfo/x/xterm", line 1, col 1:
> Illegal character (expected alphanumeric or @%&*!#) - '^Z'
> Adding myself to CC so I can see if there is a solution down the road. Let me
> know if you need anything else.
Nevermind, same output on Gentoo Linux. I don't know much about terminfo it seems. =/
% tic /usr/share/terminfo/x/xterm
"/usr/share/terminfo/x/xterm", line 1, col 1: Illegal character (expected alphanumeric or @%&*!#) - '^Z'
Indeed, so it's not a prefix isssue. I am not familiar with tic and toe. I know I made my own terminfo file once myself. However, tic according to `man` is a compiler, and looking at /usr/share/terminfo/x/xterm, it is definitely not a plain text file.
% infocmp xterm
# Reconstructed via infocmp from file: /etc/terminfo/x/xterm
xterm|xterm terminal emulator (X Window System),
(lots of control statements)
Maybe you're just looking for infocmp? That output is something that tic likes.
took me 30 mins to find this bug back
tput (for ncurses and other terminfo-based curses) uses the terminfo
mnemonics. "vi" is termcap for terminfo "civis".
I understand the issue as ncurses not knowing about Terminal.app precisely enough, can't find anything for that in Apple's patches for ncurses though.
The issue shows itself for me that the cursor isn't hidden in e.g. mutt's pager. I lack the knowledge to fix this, or find out where the exact problem is. The same ncurses and mutt (binaries/libraries) properly hide the cursor when run from xterm in Apple's X11.
Terminal.app doesn't match xterm.
There are terminfo entries in ncurses which are supposed to
match Terminal.app ("nsterm", etc). To see some of those
differences, try "infocmp nsterm xterm-new". I don't know
whether Terminal.app supports some flavor of civis/cvvis/cnorm,
but will add those if I get a reliable report to that effect.
(notwithstanding various developer's claims that their program
"emulates xterm", those are usually just claims - not fact).
On my Mac using Terminal.app:
If I set TERM=nsterm I have colours, but bold capability seems to have vanished. Cursor remains visible. If I set TERM=dtterm, I have colours, boldness and an invisible cursor in mutt's pager. I compare this to xterm-color, which Terminal.app suggests itself, and see the only difference being the invisible cursor working on dtterm, and not working on xterm-color. The home and end sequences seem to confuse Vim using dtterm while they work fine using xterm-color.
Does this help in any way?
The terminfo feature related to bold is ncv: the nsterm
entry sets that to 37, which means (see the long terminfo manpage)
that ncurses will assume that bold, reverse and standout do
not work with color. It's possible that they do not; the
relevant test is in the "tack" program. (ncurses will
simulate reverse/standout using colors, but bold is harder).
The invisible-cursor stuff is the strings that infocmp would
If you have infocmp, you also should have tic, and can experiment
with modifying a copy of the nsterm entry. (For changing cnorm/civis,
it would be nice to know the version number that Terminal.app has;
but for changing the ncv value, I'd want some tests run with "tack").
infocmp produces a source, which can be edited and recompiled with tic.
(By setting $TERMINFO, you can point things to a different directory,
and not have to modify the system's terminfo database).
alright, nsterm and xterm-color simply lack cnorm and civis (talking about sys-libs/ncurses-5.7-r2 here), like dtterm and xterm have.
Because xterm-color is more functional than nsterm to me I just modified my xterm-color terminfo file to include cnorm and civis. That gives me the invisible cursor capability.
I'm on OSX 10.4, using Terminal.app Version 1.5.1 (133-1).
nsterm and xterm-color have considerable differences. Running tack for instance pointed out that my terminal indeed doesn't support blink, like nsterm defines, but xterm-color correctly doesn't.
I'll have to go through the list of infocmp because some properties from nsterm look like I would like to have in my terminfo file too.
The usual issue with xterm-color is the bce property.
(tack does have a screen for this, in the color section).
Also, of course, function keys are probably incorrect.
In newer descriptions, I've been adding information where
terminals send different escape sequences for shift-,
control- and meta-modifiers applied to cursor- and editing-keypad
keys. (A newer Terminal.app may do this - I'm curious).
I have an OSX 10.5 installation at hand, so I can boot into that machine, and
see what Terminal.app does there later.
The bce test seems to do well "(bce) is false in the data base." and I don't
see blue lines.
My infocmp of my modified xterm-color and original nsterm look like this now:
comparing xterm-color to nsterm.
no_color_video: NULL, 37.
clear_screen: '\E[H\E[2J', '\E[H\E[J'.
clr_bol: NULL, '\E[1K'.
cursor_invisible: '\E[?25l', NULL.
cursor_normal: '\E[?25h', NULL.
delete_character: '\E[P', NULL.
ena_acs: '\E)0', '\E(B\E)0'.
enter_blink_mode: NULL, '\E[5m'.
enter_insert_mode: '\E[4h', NULL.
exit_attribute_mode: '\E[m', '\E[m\017'.
exit_insert_mode: '\E[4l', NULL.
init_2string: '\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>', NULL.
key_a1: NULL, '\EOq'.
key_a3: NULL, '\EOs'.
key_b2: NULL, '\EOr'.
key_backspace: '^H', '\177'.
key_c1: NULL, '\EOp'.
key_c3: NULL, '\EOn'.
key_dc: '\E[3~', NULL.
key_enter: NULL, '\EOM'.
key_f1: '\E[11~', '\EOP'.
key_f10: '\E[21~', NULL.
key_f11: '\E[23~', NULL.
key_f12: '\E[24~', NULL.
key_f13: '\E[25~', NULL.
key_f14: '\E[26~', NULL.
key_f15: '\E[28~', NULL.
key_f16: '\E[29~', NULL.
key_f17: '\E[31~', NULL.
key_f18: '\E[32~', NULL.
key_f19: '\E[33~', NULL.
key_f2: '\E[12~', '\EOQ'.
key_f20: '\E[34~', NULL.
key_f3: '\E[13~', '\EOR'.
key_f4: '\E[14~', '\EOS'.
key_f5: '\E[15~', NULL.
key_f6: '\E[17~', NULL.
key_f7: '\E[18~', NULL.
key_f8: '\E[19~', NULL.
key_f9: '\E[20~', NULL.
key_find: '\E[1~', NULL.
key_ic: '\E[2~', NULL.
key_mouse: '\E[M', NULL.
key_npage: '\E[6~', NULL.
key_ppage: '\E[5~', NULL.
key_select: '\E[4~', NULL.
orig_pair: '\E[m', '\E[0m'.
parm_dch: '\E[%p1%dP', NULL.
For me xterm-color works wrt function keys that in Vim if I hit the F1 key, I
also get Vim's help screen. Confusing there is that Ctrl-V F1 results in the
^OP sequence, which is not what my terminfo says. Could Vim do some special
ok, going by the differences:
If you see a 4 by 4 block of X's then (mir) should be true.
(mir) Move-in-insert-mode is true in the data base
ncv with value 37 just reports too much working which imo isn't. The NULL value reports only normal and standout to work, which seems correct.
I've fixed my function keys with tack's function keys test. At least these keys don't have special meanings on the Apple keyboard and work like this:
kf16: '\E[29~', NULL.
kf5: '\E[15~', NULL.
kf6: '\E[17~', NULL.
kf7: '\E[18~', NULL.
kf8: '\E[19~', NULL.
For the end of comment #13 - the terminal description would
be for the application-mode keys, which isn't necessarily the
same as the default settings that you could see with ^V.
(xterm does have menu entries to switch this; I don't know
what Terminal.app may do).
I asked Benjamin Sittler (the contributor for nsterm*) for his opinion.
Briefly, he recommends updating nsterm-16color (rather than xterm-color).
Sittler sent me a set of updates for nsterm, which
I added yesterday. There's a current terminfo.src
which renames the nsterm entry to nsterm-old, and adds a new
nsterm which should correspond to what you're seeing.
Using nsterm with the terminfo.src you attached seems to make it behave fine for what I've seen so far with mutt and vim.
I just found out that with TERM=nsterm, visual mode in Vim (v, V or ^v) doesn't result in a inversed background any more (I think it's called standout?). This is very bad, as you can't see what's being selected any more. I think this correlates with the ncv (off the top of my head) test in tack that for the nsterm seems to define a wrong capability, e.g. blink doesn't blink at all in this terminal.
ncv might be related - a quick compare of nsterm/nsterm-old doesn't
show anything obvious for standout (smso/rmso). To tell ncurses
that standout does not work, you might try adding ncv#1
Also, reverse might be the issue - so adding that to ncv, you'd
I added updated nsterm entries - see
I'm on Lion (10.7) these days, but also on Leopard (10.5) cursor hiding and showing again (civis, cnorm) seems to work fine under Terminal.app.
Considering this bug fixed.