Mon 08 Oct 2007 08:34:20 PM UTC, comment #3:
I ask that this bug be given higher priority.
As it is, GNU screen trashes the command-line interface on mc (midnight commander). Mc features a close integration of file manager and CLI. However, raising and lowering the file manager screen (control-O) erases the results on the CLI screen. For me, this makes screen largely unusable.
I see that bugs 19805 and 21125 are related to this one.
Thanks.
|
Tue 17 Jan 2006 02:16:25 AM UTC, comment #2:
0) Your documentation disagrees with you, it says altscreen is "just line in xterm" screen.texinfo lines 2610-2613. And obviously somebody cared what xterm does, because they went to the trouble of copying all of the escape sequences that xterm uses for this feature when they implemented it. If this altscreen feature is really supposed to be something unique to screen, you shouldn't claim that it's like xterm, or usurp its command sequences.
1) This is really a weak argument, given that screen can handle 40-some sessions with arbitrarily large scrollback buffers for each. One more page-full of buffer space isn't going to make a dent. And freeing that buffer severely limits the usefulness of the alternate screen, you might as well delete all of the altscreen code. Done like this, the last text from a pager or editor disappears when you exit, and if you needed to refer back to it, you have to regenerate the text all over again. As performance tradeoffs go, this decision harms productivity much more than it could ever help.
2) OK. It's sloppy, but it's mostly harmless.
3) This is pretty odd, since the win struct does save the cursor position, but you explicitly override that in EnterAltScreen. If you really wanted this behavior, you could have saved memory and code by not defining the w_alt_x / w_alt_y fields and just ignoring that. Sounds like extremely fuzzy thinking here.
|
Tue 17 Jan 2006 01:03:10 AM UTC, comment #1:
Well, maybe, but screen implements a "screen" terminal, not xterm, so I don't care much about what xterm does.
Let's see:
1) This is done on purpose to save memory.
2) IIRC I did that on purpose. It basically re-enters the alt-screen to re-sync with the application. The leave-alt-screen sequence works the way you want.
3) Implemention detail, I won't change this one. I don't see why it should remember the cursor position. If you look at some ti/te termcap entries, they contain extra code to save the cursor position.
|
Mon 16 Jan 2006 02:14:40 PM UTC, original submission:
Three bugs:
1) in a real xterm, the altscreen buffer is preserved when you swap back to the main screen. The current implementation always frees the alt buffer when you swap; the FreeAltScreen function should be removed and references to it should be deleted.
2) in a real xterm, it remembers which screen you're in. If you're on a particular screen and reissue the command to enter that screen, nothing happens. The current implementation always toggles to the other buffer, regardless of what the actual escape code was.
3) in a real xterm, it remembers your cursor position on each screen. The current implementation always sets the cursor to its position from the main screen, even when displaying the alternate screen. This tends to garble/overwrite whatever was on the alternate screen.
#1 is most important to me; I use shell aliases "xt1" and "xt0" to flip back and forth between buffers all the time. With the current behavior, there's nothing to flip back to after you exit the alternate screen. Most people probably don't notice the bug because the default xterm termcap defines the te sequence to clear the screen before leaving the alternate buffer. This is a bug in the xterm termcap entry, which is a separate issue.
#2 is relatively benign, but still ought to be fixed.
|