如何从向上滚动的 tmux 窗格切换到另一个 tmux 窗格?

发布于 2025-01-12 18:18:19 字数 287 浏览 1 评论 0原文

如果我打开了两个 tmux 窗格,然后使用 CTRL-B [ 转到其中一个窗格并滚动回历史记录,那么由于某种原因,我无法在不滚动当前窗格的情况下切换到另一个窗格回到底部。有谁知道如何解决这个问题?请注意,我使用了一些自定义 tmux 配置,如此处所述,以便更轻松地在 vim 窗口和 tmux 窗格之间导航。这是否会扰乱 tmux 滚动的工作方式?

If I have two tmux panes open and I go to one and scroll back to the history using CTRL-B [, then for some reason I can't switch to the other pane without making the current pane scroll back to the bottom. Does anyone know how to work around this? Note that I use some custom tmux configuration, as described here, to make it easier to navigate between vim windows and tmux panes. Is this somehow messing up how tmux scrolling works?

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

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

发布评论

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

评论(1

自演自醉 2025-01-19 18:18:19

当 tmux 处于复制模式时,您是否可能会遇到冲突的默认键绑定?

当 tmux 运行时,您可以通过执行 prefix+? 检查当前活动的键绑定。当我在裸 tmux 配置上执行此操作时,我可以看到 Ck 绑定到 send-keys -X copy-end-of-line,并且它将移动处于复制模式的缓冲区到缓冲区的末尾,就像您所描述的那样。或者,如果您使用 tmuxcopy-mode-vi,那么看起来 Cj 默认绑定到 发送键 -X 复制选择并取消

尝试将以下内容添加到您的 .tmux.conf 中:

unbind-key -Tcopy-mode C-k
unbind-key -Tcopy-mode-vi C-j

在此配置更新后,我可以使用 CjCk 导航窗格,如您链接的文章中所述。

Is it possible you're running into a conflicting default keybinding for tmux when it's in copy mode?

When tmux is running, you can check the currently active keybindings by doing prefix+?. When I do this on a bare tmux config, I can see that C-k is bound to send-keys -X copy-end-of-line, and it will move a buffer that's in copy mode to the end of the buffer, like you're describing. Alternatively, if you're using tmux's copy-mode-vi, then it looks like C-j is bound by default to send-keys -X copy-selection-and-cancel.

Try adding the following to your .tmux.conf:

unbind-key -Tcopy-mode C-k
unbind-key -Tcopy-mode-vi C-j

After this configuration update, I'm able to use C-j and C-k to navigate panes like described in the article you linked.

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