如何滚动浏览 tmux 的命令历史记录?

发布于 2024-12-26 11:02:28 字数 75 浏览 2 评论 0原文

Cb:为您提供 tmux 命令提示符。
有没有办法滚动浏览之前输入的命令?
向上箭头或 Ctrl p/n 似乎不起作用。

C-b: gives you tmux command prompt.
Is there a way to scroll through the commands entered on it previously?
Up arrow or Ctrl p/n don't seem to work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜中书 2025-01-02 11:02:28

UpDown默认 (Emacs) 模式下工作;但是,如果您设置了 vi-mode,那么您将需要显式进入命令模式(通过在 tmux 的命令提示符处按 Escape 一次 - Ctrlb,:),或者您可以在 .tmux.conf 中为这些命令创建按键绑定,从而消除需要更改模式:

set -g status-keys vi
bind-key -t vi-edit Up   history-up
bind-key -t vi-edit Down history-down

可以使用 Ctrlb: 查看 Tmux 的默认绑定,然后输入 lsk -t vi-edit.在本例中,默认值是:

bind-key -ct vi-edit   Up   history-up
bind-key -ct vi-edit   Down history-down

注意命令模式的 -ct 开关。

Up and Down work in the default (Emacs) mode; if however, you have set vi-mode then you will need to either explicitly enter command mode (by pressing Escape once at tmux's command prompt—Ctrlb,:), or you can create keybinds for those commands in your .tmux.conf, thereby removing the need to change modes:

set -g status-keys vi
bind-key -t vi-edit Up   history-up
bind-key -t vi-edit Down history-down

Tmux's default bindings can be seen with Ctrlb,: and then entering lsk -t vi-edit. The defaults are, in this case:

bind-key -ct vi-edit   Up   history-up
bind-key -ct vi-edit   Down history-down

Note the -ct switch for command mode.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文