如何清除 Tmux 中的回滚缓冲区? [英] How can I clear scrollback buffer in Tmux?

查看:53
本文介绍了如何清除 Tmux 中的回滚缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅供参考,我正在通过 Mac OS X 终端应用程序使用 Tmux.

FYI, I am using Tmux through the Mac OS X Terminal app.

推荐答案

同样的问题已经困扰我很长时间了.这是我想出的最好的.把它放到你的 .tmux.conf 文件中:

This same question has been plaguing me for quite some time. Here's the best I've come up with. Put this into your .tmux.conf file:

bind -n C-k clear-history

这将 ctrl-k 绑定到 tmux clear-history 命令.绑定后的 -n 使您不必发出 tmux 命令前缀(默认情况下为 ctrl-b).我使用 bash,所以 ctrl-l 已经相当于在命令行输入clear".使用这两个键,我得到了一个不错的 ctrl-l、ctrl-k 组合,它将所有滚动缓冲区移出屏幕(清除"),然后删除所有历史记录(tmux清除历史"命令).

This binds ctrl-k to the tmux clear-history command. The -n after bind makes it so you don't have to issue the tmux command prefix (ctrl-b by default). I use bash, so ctrl-l already does the equivalent of typing "clear" at the command line. With these two keys I get a nice ctrl-l, ctrl-k combo, which moves all the scroll buffer off the screen (the "clear") and then deletes all that history (the tmux "clear-history" command).

它不像 Terminal 的、iTerm 的或 Konsole 的一键组合来清除它那么好,但它比一直输入清除历史记录更好.

It's not quite as nice as Terminal's, iTerm's, or Konsole's 1-key combos for clearing it out, but it's a world better than typing in clear-history all the time.

这篇关于如何清除 Tmux 中的回滚缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆