8

我正在尝试将 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 分别绑定到 ^[[1;3D 和 ^[[1;3C 。我想我必须使用 terminfo override 来告诉 tmux 使用这些序列,但我不知道如何。因此,任何帮助将不胜感激。

谢谢!

4

1 回答 1

1

如果xterm-keys选项关闭,tmux将忽略键(因为它会识别它们并在未设置选项时丢弃它们)。一段时间以来,用户tmux一直对这种区别感到困惑,并且在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 中指出的,没有得到正确的前缀 + 箭头键

于 2017-02-19T19:55:47.183 回答