使用 emacs -nw 和 gnu screen 时如何保留 putty 回滚缓冲区?
这是我的问题 - 希望我能很好地解释这一点:
我在 Windows 上使用 Putty,然后启动 gnu screen 会话。我可能会在 putty 中运行多个 shell 命令,然后在同一屏幕中运行 emacs -nw。问题是,当我退出 emacs 时,回滚缓冲区(在 putty 中)被搞乱了。当我启动 emacs 时屏幕上的内容消失了,如果我向上滚动,我会看到屏幕的各种痕迹(例如底部的屏幕“栏”等)。
如果我不使用 screen 而是直接从 putty 打开 emacs -nw,那么当我退出 emacs 时,我的所有历史记录仍然存在于缓冲区中。
同样,如果我确实使用 screen,并在屏幕中使用 vi 而不是 emacs,那么当我退出 vi 时,一切都在那里。
这只是 putty 和 emacs 之间的一些奇怪的交互吗?有办法解决吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过将回滚缓冲区大小设置为默认值以外的其他值? scrollback
在 .screenrc 中放入以下行:
这是我的配置 .screenrc 。尝试重现这个问题,但没有运气......你可以尝试它是否适合你:
最后我建议你熟悉 tmux -> http://tmux.sourceforge.net/
顺便说一句。希望您使用的是最新版本的 PuTTy,对吧? :) - > http://puttytray.goeswhere.com/
Have you tried setting scrollback buffer size to something else than default? scrollback
In .screenrc put this line:
Here's my config .screenrc. Tried to reproduce this problem but no luck... you can try if it fixes for you:
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/
这听起来像是 Emacs 和 Screen 在终端的备用屏幕功能上互相踩踏。
我无法重现此问题,但也许将以下内容放入 ~/.screenrc 中会有所帮助:
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:
您是否考虑过使用 tmux 作为 GNU 屏幕的替代品?
Have you considered using tmux as an alternative to GNU screen?