我一直在搞 TMUX,我喜欢配置能力。
底部的窗口列表让我认为在 Irssi 中更改窗口的相同快捷方式应该在 TMUX 中工作,但它没有。
所以目前,我必须按 Cb 然后按一个数字才能打开该窗口。我很高兴将 Cb 作为我的普通前缀,(例如,对于 Cb ?寻求帮助,Cb:命令条目)但是如果我可以同时使用 C-b+Numkey 和Alt+NumKey来更改制表符,那就太酷了。
如果它可以检测窗口是否显示 Irssi,然后忽略Alt+ NumKey,这样我仍然可以在 Irssi 窗口之间切换,那就更酷了。
Lyn*_*ite 18
可以通过添加以下内容来使用 Alt 切换窗口:
# switch windows alt+number
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
Run Code Online (Sandbox Code Playgroud)
到你的~/.tmux.conf
这是来自:https : //github.com/proft/dotfiles/blob/master/.tmux.conf
此外,如果 irssi 在活动窗口中,则使其不执行此操作:
#switch windows alt+number, unless we are running irssi
bind -n M-1 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 1' 'send M-1'
bind -n M-2 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 2' 'send M-2'
bind -n M-3 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 3' 'send M-3'
bind -n M-4 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 4' 'send M-4'
bind -n M-5 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 5' 'send M-5'
bind -n M-6 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 6' 'send M-6'
bind -n M-7 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 7' 'send M-7'
bind -n M-8 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 8' 'send M-8'
bind -n M-9 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 9' 'send M-9'
bind -n M-0 if 'test `tmux list-panes -F "#W"` != "irssi"' 'select-window -t 0' 'send M-0'
Run Code Online (Sandbox Code Playgroud)
其中粗略读取Bind key [无需前缀],执行的操作:检查当前窗格是否未命名为irssi,如果不是则选择相应的窗口,否则重新发送key,以便底层应用程序[irssi]可以得到。