tmux 上滚_实践中的tmux:回滚缓冲区

本文介绍了tmux与终端回滚缓冲区的区别,以及如何调整tmux的复制模式、滚动和鼠标选择。在tmux中,超出视区的输出会被内部回滚缓冲区保存,而非终端的回滚历史。可以通过tmux特定的控制键访问其内部回滚。此外,还可以配置tmux以在iTerm中使用熟悉的滚动控制。文章还提供了修改鼠标滚动行数、保持复制模式以及改善鼠标选择体验的方法。
摘要由CSDN通过智能技术生成

tmux 上滚

by Alexey Samoshkin

通过阿列克谢·萨莫什金(Alexey Samoshkin)

实践中的tmux:回滚缓冲区 (tmux in practice: the scrollback buffer)

终端和tmux回滚缓冲区之间的区别,以及如何调整tmux行为的复制模式,滚动和鼠标选择。 (The difference between terminal and tmux scrollback buffers, and how to tweak copy mode, scroll, and mouse selection of tmux behavior.)

This is 3rd part of my tmux in practice article series.

这是我的tmux实践文章系列的第3部分。

Usually terminal emulators implement scrollback buffer, so you can explore past output, when it moves out of view. tmux, like other full-screen terminal applications like vim, runs in so-called alternate screen buffer of a parent terminal. Alternate buffer has exact width and height dimensions as physical window size.

通常,终端仿真器会实现回滚缓冲区,因此当移出视图时,您可以浏览过去的输出。 像vim等其他全屏终端应用程序一样,tmux在父终端的所谓备用屏幕缓冲区中运行。 备用缓冲区具有与物理窗口大小相同的宽度和高度尺寸。

There are several effects of using alternate buffer:

使用备用缓冲区有几种效果:

  • Any output, that exceeds visible part of alternate buffer, is lost. As soon as lines go out of view, they are lost. To prevent history loss, tmux implements it’s own “inner” scrollback buffer. The consequence of this is that you cannot work with tmux inner scrollback same as you usually do within your terminal.

    任何超出备用缓冲区可见部分的输出都将丢失。 一旦视线消失,它们就会丢失。 为了防止历史记录丢失,tmux实现了它自己的“内部”回滚缓冲区。 这样的结果是,您无法像在终端机中一样使用tmux内部回滚。
  • Any output produced inside tmux (the same is true for vim, nano, man, less, and so on) does not spill over into the outer terminal’s scrollback history. When you close your full-screen app, you get back to the same state when you launched the app and don’t see output from inside the app any more.

    tmux内部产生的任何输出(vim,nano,man,less等的情况也是如此)不会溢出到外部终端的回滚历史记录中。 关闭全屏应用程序时,启动应用程序时会回到相同的状态,并且不再看到应用程序内部的输出。

In practice, if you get used to scroll back using ⌘↑ in your iTerm and if you’re going to do the same inside running tmux session, you will control and scroll the outer iTerm’s scrollback buffer, rather than the tmux’s inner scrollback buffer.

实际上,如果您习惯在iTerm中使用⌘↑向后滚动,并且如果要在运行tmux会话中执行相同的操作,则将控制并滚动外部iTer

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值