Re: Possible screen problem... but where?
Gordon Russell <firstname.lastname@example.org> writes:
> Has anyone else noticed that now when you quit a curses-based program in
> an xterm tcsh window the screen is not currectly reset? Normally, your cursor
> position is restored to the line after the command you last typed (such as vi
> or mutt). Now it appears where ever it was when the application was terminated
> (like the middle of the screen). This means that I have to use ^L quite often
> to make sense of the screen.
> If noone has reported this, could someone suggest which package could be at
> fault? I am running an "unstable" distribution. I guess it is one of the curses
> libraries, and I have 3.4 and 4 installed.
I've been noticing it too, and have been having trouble tracking it
down. I've been noticing it mostly with vi (I use nvi), and do have a
reliable way of reproducing it; I'm inclined to think that this is a
bug either in xterm or in the terminfo description for the
'xterm-debian' terminal, however, as it doesn't seem to happen when I
set the value of TERM to 'xterm'.
Incidentally, the quickest way to reproduce this is to execute 'vi'
and enter the following six keystrokes:
i <enter> <escape> : q !
I've tracked it down to this: (terminfo stuff to follow)
For some reason, the 'sc' sequence affects the stored cursor position
that the 'smcup/rmcup' sequence uses. The 'sc' sequence is apparently
being generated as vi attempts to simulate the "insert line"
capability through a 'sc', 'csr(1,22)', 'rc', 'cud1', 'ri', 'csr(0,23)'
sequence. At least, that's what I think vi is trying to do with that
sequence - why it doesn't just use the provided 'il1' sequence is
beyond me. I'd now like to know what part of this behavior is new - is
this vi behavior new (indicating curses library problems), or is
xterm's response to it new?
Could someone with an xterm from hamm try: (after clearing the screen
and setting the xterm to be the standard 24 x 80 size)
tput smcup; tput cup 10 20; tput sc; tput rc; tput cup 23 0; tput rmcup
and tell me if that bit of shell language results in one's prompt
appearing on the bottom line (which is less than ideal, but perfectly
liveable), on the second line (which is ideal) or in the middle of the
screen (which is the current broken behavior)?
Also, does anyone know where to find documentation on xterm escape codes?