Discussion:
termcap vs terminfo, less, and Mac OS X
Walt Pawley
2006-06-02 21:26:07 UTC
Permalink
I've been messing about with FreeBSD lately, though mostly I
use Mac OS X. I've grown accustomed to using "less" as a pager,
generally preferring the manner in which it would make all the
scrolled through crud vanish when I was done pawing about in
it. But "less" didn't behave that way when telnet'd into the
the FreeBSD boxes on the LAN - whatever got presented scrolled
"up" into the terminal program's capture buffer.

After mucking with this for a couple of days, I believe the
reason is that the termcap description of "xterm-color" in
FreeBSD doesn't match the "xterm-color" terminfo description in
either Mac OS X or Linux (which seem to be identical). In
particular, the "ti" and "te" capabilities are null.

Is this intentional or something that should be generically "fixed"?
--
Walter M. Pawley <***@wump.org>
Wump Research & Company
676 River Bend Road, Roseburg, OR 97470
541-672-8975
Thomas Dickey
2006-06-02 21:37:26 UTC
Permalink
Post by Walt Pawley
I've been messing about with FreeBSD lately, though mostly I
use Mac OS X. I've grown accustomed to using "less" as a pager,
generally preferring the manner in which it would make all the
scrolled through crud vanish when I was done pawing about in
it. But "less" didn't behave that way when telnet'd into the
the FreeBSD boxes on the LAN - whatever got presented scrolled
"up" into the terminal program's capture buffer.
After mucking with this for a couple of days, I believe the
reason is that the termcap description of "xterm-color" in
FreeBSD doesn't match the "xterm-color" terminfo description in
either Mac OS X or Linux (which seem to be identical). In
particular, the "ti" and "te" capabilities are null.
Most of the Linux's have xterm-color the same as in ncurses.
A couple (I've observed) do as in Mac OS X and choose some flavor of
xterm to replace it. There's no standard choice for the replacement.

The choice of whether to have ti/te null is arbitrary (half of xterm's
users like the alternate screen, half don't).
Post by Walt Pawley
Is this intentional or something that should be generically "fixed"?
The fix is simply not to use "xterm-color". It doesn't correspond to
any terminal type, is useful only to people who don't care to find out
what the terminal is.

For instance, you've not identified the terminal type. Find out what
it is...

xterm supports ANSI color, VT220 emulation and UTF-8
There's an faq at
http://invisible-island.net/xterm/xterm.faq.html
ftp://invisible-island.net/xterm/

The current version of ncurses is 5.5 (20051010)
There's an faq at
http://invisible-island.net/ncurses/ncurses.faq.html
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Loading...