gpt4 book ai didi

terminal - 在 tmux 中使用 Alt-left/right 在窗口之间切换

转载 作者:行者123 更新时间:2023-12-03 22:28:14 25 4
gpt4 key购买 nike

我正在尝试将 tmux 配置为使用 alt-left、alt-right 序列在窗口之间切换。这就是我的 .tmux.conf 中的内容

bind-key -n M-Left previous-window
bind-key -n M-Right next-window

不幸的是,它不起作用。在我的机器上,alt-left 和 alt-right 分别绑定(bind)到 ^[[1;3D 和 ^[[1;3C 。我想我必须使用 terminfo override 来告诉 tmux 使用这些序列,但我不知道如何。因此,任何帮助将不胜感激。

谢谢!

最佳答案

如果 xterm-keys选项已关闭,tmux将忽略键(因为它会识别它们并在未设置选项时丢弃它们)。 tmux 的用户有一段时间被这个区别弄糊涂了,在 end of 2016 ,开发人员更改了该选项的默认值:

Change the xterm-keys option to default to on, so that tmux will generate xterm(1) escape sequences for function keys with modifiers.

With the option off most of these keys are ignored by default, except
for ctrl + arrows which use a variant that nothing else seems to use and
I don't remember why we chose. The xterm escape sequences are now the
most common.

正如我在 tmux on remote machine not getting correct prefix + arrow keys 中指出的那样,这仍然依赖于终端描述。

关于terminal - 在 tmux 中使用 Alt-left/right 在窗口之间切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18109175/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com