我对 tmux 比较陌生,只是将它用于本地开发。在某些 tmux 教程中,人们会在枚举列表中列出他们的 tmux 会话。通常有黄色高光。有谁知道我在说什么以及如何去做?其次,你会说这是最佳实践吗?我在这里打开了 8 个 iTerm2 选项卡:(
这是我正在寻找的截图:
ctrl+b, s
注意ctrl+b是我的前缀,你的前缀可以是别的。
是
PREFIX s
,但真正的命令是选择树。然后你可以用它来绑定到其他键,例如'S'
bind S choose-tree
http://man.openbsd.org/OpenBSD-current/man1/tmux.1#choose-tree
如果要即时切换,请使用
tmux switch -t [target-session]
如果你
man tmux
你会发现一个tmux选项列表:
C-( Switch the attached client to the previous session.
C-) Switch the attached client to the next session.
无需更改您的 tmux.conf
Ctrl-b Shift-9 和 Ctrl-b Shift-0
例如,使用 shell 别名可以通过名称进行更快的切换。对于 zsh,它可以如下所示:
function tn() (
if [ -n "$1" ]
then
tmux switch -t $1
else
echo "no session name"
fi
)
使用
tn go
切换到名称为 go 的 tmux 会话。