3
votes

Here's my problem - hopefully I can explain this well enough:

I use Putty on Windows, and then start a gnu screen session. I may run several shell commands in putty, and then in the same screen, run emacs -nw. The problem is that when I exit emacs, the scrollback buffer (in putty) is messed up. What was on the screen when I started emacs is gone, and if I scroll upward I see various artifacts of screen (e.g. the screen "bar" at the bottom, etc.).

If I don't use screen and just open emacs -nw directly from putty, all my history is still there in the buffer when I exit emacs.

Likewise, if I do use screen, and use vi within a screen instead of emacs, when I exit vi, everything is there.

Is this just some weird interaction with putty and emacs? Is there a way to fix it?

3
screen, of course, has its own scrollback feature. Ctrl-a esc.tripleee
Yes - when I use that, all the history is completely gone. So I can see a little of it if I scroll up using the mouse wheel or bar on the right, or none of it if I scroll up using screen's scrollback (I can just scroll up forever and everything is blank).Jer

3 Answers

1
votes

Have you tried setting scrollback buffer size to something else than default? scrollback

In .screenrc put this line:

defscrollback 10000

Here's my config .screenrc. Tried to reproduce this problem but no luck... you can try if it fixes for you:

termcapinfo xterm* ti@:te@
startup_message off
vbell off
autodetach on
altscreen on
shelltitle "$ |bash"
defscrollback 10000
defutf8 on
nonblock on

hardstatus alwayslastline
hardstatus string '%{= kw}[ %{= kb}%H%{= kw} ][%= %{= kw}%?%-Lw%?%{= kW}%n*%f %t%?%?%{= kw}%?%+Lw%?%?%= ][ %{r}%l%{w} ]%{w}[%{r} %d/%m/%y %C %A %{w}]%{w}'

bind 'q' quit

Just at the end I would as well suggest you getting familiar with tmux -> http://tmux.sourceforge.net/

BTW. hopefully you're using newest version of PuTTy right? :) - > http://puttytray.goeswhere.com/

0
votes

This sounds like Emacs and Screen are stepping on each others toes over the alternate screen feature of your terminal.

I cannot reproduce this issue, but maybe putting the following in your ~/.screenrc would help:

altscreen on
0
votes

Have you considered using tmux as an alternative to GNU screen?