macos Mac os x Terminal.app 的缓冲区和屏幕命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1039442/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mac os x Terminal.app's buffer and screen command
提问by Arvind
I use Mac os x Terminal.app to connect to my remote machine and then use screen on that machine.
我使用 Mac os x Terminal.app 连接到我的远程机器,然后在该机器上使用屏幕。
Is there a way to use the scrollbars on Terminal to scroll back and forth on the screen's buffer. It is painful to do ctrl+a + Esc and then Page Up/Down
有没有办法使用终端上的滚动条在屏幕缓冲区上来回滚动。执行 ctrl+a + Esc 然后 Page Up/Down 很痛苦
Thanks Arvind
谢谢阿文德
回答by Yarrow
To expand on the previous two answers: the .screenrc line
扩展前两个答案:.screenrc 行
termcapinfo xterm* ti@:te@
will turn on your scrollbars. This is a win unless you're using control-A to switch between multiple screen sessions in the same Terminal window. Screen uses what's called cursor addressing mode to keep a separate history buffer for each session; the termcapinfo line above tells it never to use that mode. All history then goes into one buffer, the native Terminal buffer, and you'll see lines from all sessions mixed in with each other.
将打开您的滚动条。这是一个胜利,除非您使用 control-A 在同一终端窗口中的多个屏幕会话之间切换。Screen 使用所谓的光标寻址模式为每个会话保留一个单独的历史缓冲区;上面的 termcapinfo 行告诉它永远不要使用该模式。然后所有历史记录进入一个缓冲区,即本地终端缓冲区,您将看到来自所有会话的行相互混合。
These days that just means using a separate Terminal window (or tab) for each login on your remote -- a low price to pay for getting your scrollbars back, to my mind.
如今,这只是意味着在遥控器上为每次登录使用单独的终端窗口(或选项卡)——在我看来,这是让滚动条恢复的低价。
So why isn't scrollbar mode the default? Because in Ye Olde Tyme Dayes when we walked twenty miles in the snow to our 80 by 24 character-cell VT100s, you could only get one login per terminal. Unless you had two terminals on your desk, screen was the only multi-session game in town.
那么为什么滚动条模式不是默认的呢?因为在 Ye Olde Tyme Dayes,当我们在雪地里走了 20 英里到达 80 x 24 字符单元的 VT100 时,每个终端只能登录一次。除非你的办公桌上有两个终端,否则 screen 是城里唯一的多会话游戏。
回答by Joe Martinez
Adding the following to ~/.screenrc should do what you want.
将以下内容添加到 ~/.screenrc 应该可以满足您的需求。
termcapinfo xterm* ti@:te@
回答by Balázs Pozsár
I do not think you will be able to use the terminal's scrollbar in screen, because the terminal only knows about the 80x25 or so sized portion, and the display caching is done in the screen process.
我认为您无法在屏幕中使用终端的滚动条,因为终端只知道 80x25 左右大小的部分,并且显示缓存是在屏幕过程中完成的。
You could try to bind it to an easier combo, see the CUSTOMIZATION section of the man page.
您可以尝试将其绑定到更简单的组合,请参阅手册页的 CUSTOMIZATION 部分。