2013-08-07 31 views
4

我試圖配置tmux以使用alt-left,alt-right序列在窗口之間切換。這是我在我的.tmux.conf中有的使用Alt-left/right在tmux中的窗口之間切換

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

不幸的是,它不起作用。在我的機器上,alt-left和alt-right分別綁定到^ [[1; 3D和^ [[1; 3C)。我想我必須使用terminfo覆蓋來告訴tmux使用這些序列,但我不知道如何。所以,任何幫助將不勝感激。

謝謝!

+0

* tmux *應自動識別這些序列,無論您在外部使用什麼TERM(也不管相應的terminfo條目是什麼)。將這些條目放入配置文件後,你重新啓動了* tmux *服務器嗎?如果所有的命令都是冪等的,你可以在你的現有服務器上使用'source〜/ .tmux.conf'來獲取更改。 –

+0

@ChrisJohnsen我絕對確定tmux選擇了配置。 –

+0

你有沒有找到答案?我與Ubuntu 12.04,終結者0.96和tmux 1.9a有同樣的問題。 – danns87

回答

0

如果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指出