On Thu, Aug 31, 2000 at 01:17:20PM +1100, Trent Swift wrote: > When you telnet/ssh from an xterm on a dec/solaris box to potato > machine with ncurses.v.5.0-6, and then run less (or something that > uses /etc/terminfo/x/xterm) the screen goes into reverse video for all > output and with vi/emacs they fail to guess the size of the screen > correctly.
See <http://dickey.his.com/xterm/xterm.faq.html>. Specifically: Reverse video is not reset When running less or other programs that do highlighting, you see the highlighting not turned off properly. This may be due to incompatible terminal descriptions for xterm. With XFree86 3.2, I modified the terminal description for XFree86 xterm to use the VT220 (aka ISO 6429) controls that allow an application to turn off highlighting (or bold, underline) without modifying the other attributes. The X Consortium xterm does not recognize these controls. If, for example, you are running an older xterm and rlogin to a system where the newer xterm has been installed, you will have this problem, because both programs default to $TERM set to xterm. The solution for mixed systems is to install the newer terminal description as as a different name (e.g., xterm-color) and set the termName resource accordingly in the app-defaults file for the system which has the newer xterm. However - see below. What $TERM should I use? The xterm-color value for $TERM is a bad choice for XFree86 xterm because it is commonly used for a terminfo entry which happens to not support bce. Use the xterm-xfree86 entry which is distributed with XFree86 xterm (or the similar one distributed with ncurses). The term "bce" stands for "back color erase". Terminals such as XFree86 xterm and rxvt implement back color erase, others such as dtterm do not. (Roughly half of the emulators that I know about implement bce). When an application clears the screen, a terminal that implements back color erase will retain the last-set background color. A terminal that does not implement back color erase will reset the background color to the default or initial colors. Applications that paint most of the screen in a single color are more efficient on terminals that support back color erase. Curses libraries that support color know about bce and do the right thing - provided that you tell them what the terminal does. That is the whole point of setting $TERM. The "xterm-color" description distributed with ncurses does not list bce, because it was applied originally to a terminal type which does not implement back color erase. It will "work" for XFree86 xterm, though less efficient. Some other applications such as the slang library have hardcoded support for terminals that implement back color erase. Given the "xterm-color" description, those will be efficient - and fortuitously work. However, slang (through version 1.4.0) does not work properly for the terminals that xterm-color was designed for. See this page for an example of (n)curses and slang running on dtterm. That bug in slang is reported to be fixed for succeeding versions, though your application may require changes to use this fix. (The demo which comes with slang to illustrate the use of bce does not work properly, for instance). The xterm-color value for $TERM is also (for the same reason) a bad choice for rxvt, but "works" due to the large number of hard-coded applications that override this. ******************* You can use the -tn option to xterm to have it use a different terminal type: -tn name This option specifies the name of the terminal type to be set in the TERM environment variable. This terminal type must exist in the termcap(5) database and should have li# and co# entries. (Of course, a terminfo entry works as well.) Try xterm-r6, perhaps. -- G. Branden Robinson | Debian GNU/Linux | Music is the brandy of the damned. [EMAIL PROTECTED] | -- George Bernard Shaw http://www.debian.org/~branden/ |
pgpTiQsutWSyA.pgp
Description: PGP signature