开发者

How can I keep my putty scrollback buffer when using emacs -nw and gnu screen?

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 i开发者_Python百科n 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?


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/


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜