Re: Annoying behavior in X (broken curses?)
John Goerzen <firstname.lastname@example.org> writes:
> After I recently upgraded my hamm system, there is a new annoying
> problem. Whenever a curses program starts under rxvt, the screen is
> cluttered with debris from the LAST curses program. For instance,
> less and joe both have this problem and I have to hit the redraw key
> after starting them. This is a new problem.
This problem is not an rxvt bug. One way in which the terminfo entries of
rxvt and xterm differ, is the rmcup capability. Xterm's entry contains
an additional control sequence ("ESC [ 2 J" to be precise) that clears
the screen before switching from the alternate screen buffer.
> An old problem that occurs with both rxvt and xterm is that when one
> exits a curses program, the display goes to something else. This is
> particularly annoying with less, since I often want to keep on-screen
> the information that I was viewing. Any ideas on what this problem is?
Avery Pennarun <email@example.com> writes:
> This is a "feature" that has been around for a long time. I hate
> it, myself.
> xterm and several of the later DEC VTxxx terminals added support for a
> "secondary" screen, which (rather foolishly, IMHO) allows you to swap
> the display for another.
> The advantage of this is supposed to be that if I start 'joe' to
> edit a file, then exit, I will be right back at my command prompt
> with the most recent set of commands, 'ls' output, etc still there.
> Realistically, I would much rather see the end of my 'joe' or 'less'
> session than commands I typed ten minutes ago.
> You can avoid this behaviour by setting your TERM variable to vt100,
> because vt100's didn't have this silly feature. Unfortunately, the
> vt100 entry also doesn't have entries for HOME, END, PGUP, etc keys
> that I love so much.
> Any votes to remove "secondary screen" support from the rxvt termcap
The less utility's -X flag will prevent it from switching screens.
Another advantage of the alternate screen buffer is that the
contents of the scrollback buffer (for those that use the scrollbar or
Shift-PgUp/PgDn) is not corrupted by (curses) applications that use the
It is always possible to define your own terminfo entry for rxvt with this
feature disabled. For example:
$ mkdir $HOME/.terminfo
$ export TERMINFO
$ cat > rxvt-nas.terminfo <<EOF
> rxvt-nas|rxvt terminal emulator (without alternate screen),
> use=rxvt, smcup=\E7, rmcup=\E8,
$ tic rxvt-nas.terminfo
$ rm rxvt-nas.terminfo
Then by setting TERMINFO to $HOME/.terminfo and TERM to rxvt-nas instead
of rxvt, curses applications will not use rxvt's alternate screen buffer.
Unfortunately, rxvt does not have a feature like xterm to tell it to
ignore the control code for switching to and from the alternate screen
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to firstname.lastname@example.org .