Subject: problem with screen.rxvt TERM and less

From: [email-masked] (Henry S. Thompson)
Date: Fri, 07 Nov 2008 15:57:55 +0000

I built screen 4.0.3 from source, with cygwin patches, on cygwin, with
ncurses 5.7, and rxvt for my terminal emulator.

The 'less' program has an irritating fault in this configuration which
I can't figure out how to work around:

 * When using less in a vanilla rxvt window, the screen returns to its
   pre-less state after quitting less -- good.

 * When using less in a screen-managed window, with TERM=screen.rxvt,
   the screen shows the last page displayed by less after quitting
   less -- not good.

Do others have this problem?  Any suggestions welcome.

Thanks,

ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
                         Half-time member of W3C Team
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: [email-masked]
                       URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]

_______________________________________________
screen-users mailing list
[email-masked]
http://lists.gnu.org/mailman/listinfo/screen-users

---

From: Micah Cowan <[email-masked]>
Date: Fri, 07 Nov 2008 11:00:22 -0800

>    the screen shows the last page displayed by less after quitting

I'm not entirely sure I understand what the symptom is that you're
describing for running less under the screen-managed window, but it
sounds like it might be similar to this one, which is fixed in the
current dev sources:

https://savannah.gnu.org/bugs/index.php?23803

(read from the bottom up).

Also, I don't know what screen.rxvt's definition is, since that's not a
standard term name. Hopefully your system has proper definitions set up
for that.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/

---

From: [email-masked] (Henry S. Thompson)
Date: Sun, 09 Nov 2008 22:02:04 +0000

> sounds like it might be similar to this one, which is fixed in the

Thanks for your help, but I don't _think_ this is what's at issue.
More poking around suggests a _possible_ alternative explanation.  It
appears that less uses the alternate screen buffer for its display,
which is why when it finishes in a vanilla xterm-color or rxvt window,
you see no remnants of the displayed file.  But I guess, from what I
can gather of how screen is implemented, that screen is _already_
using the alternate screen buffer, so when less asks to switch to it,
it can't???

As far as I can see, less is sending the
correct-per-terminfo-for-screen escape sequences, i.e. ESC[?1049h for
smcup and ESC[?1049l for rmcup, but they are not having the desired
effect. . .

[Note that when running in a vanilla rxvt window smcup is ESC7ESC[?47h
and rmcup is ESC[?47lESC8 . . . ]

Does this make better sense yet?  I've attached pngs of the winning
and losing displays.

Thanks

ht

---

From: Micah Cowan <[email-masked]>
Date: Sun, 09 Nov 2008 17:14:14 -0800

> using the alternate screen buffer, so when less asks to switch to it,

Oh, is that the problem?

Screen has its own built-in "alternate screen buffers"; just add the
"altscreen" command to your ~/.screenrc.

- --
Micah J. Cowan

---

From: [email-masked] (Henry S. Thompson)
Date: Mon, 10 Nov 2008 10:22:18 +0000

> "altscreen" command to your ~/.screenrc.

D'oh!  That fixed it.  Thank you for your patience, and for not just
replying 'RTFM'.

ht
- --

---

From: Micah Cowan <[email-masked]>
Date: Mon, 10 Nov 2008 09:41:51 -0800

> D'oh!  That fixed it.  Thank you for your patience, and for not just

Note that, now that you have altscreen on, if you're running screen
4.0.3 you may run into that other problem I pointed you at: less
mysteriously displaying an empty screen until you refresh with Ctrl+L.
That's a bug in less, combined with a pseudo-bug in screen. Screen's
issue has been fixed in current sources (and no other terminal would be
particularly likely to trigger less's issue).

- --
Micah J. Cowan