在 tmux 中切换会话?

我对多功能混音还比较陌生,只是用于当地的发展。在一些 tmux 教程中,用户将在枚举列表中列出他们的 tmux 会话。通常会有黄色的高光。有人知道我在说什么,怎么做吗?其次,你认为这是最佳实践吗?我在这里打开了8个 iTerm2标签: (

下面是我正在寻找的东西的截图:

enter image description here

44817 次浏览

You're looking for C-b ( and C-b ). You can find this and many more wonderful tips on the tmux cheatsheet.

CTRL-b s

found it! Alex's answer is awesome as well. Note CTRL-b is my prefix, your prefix could be something else.

Is PREFIX s but the real command is choose-tree. Then you can use it to bind to other key for example to 'S'

bind S choose-tree

http://man.openbsd.org/OpenBSD-current/man1/tmux.1#choose-tree

Use tmux switch -t [target-session] if want to switch instant

A faster switch by name is for example possible with a shell alias. For the zsh it can look as follows:

function tn() (
if [ -n "$1" ]
then
tmux switch -t $1
else
echo "no session name"
fi
)

With tn go you switch to the tmux session with name go.

if you man tmux you will find a list of tmux options:

C-( Switch the attached client to the previous session.
C-) Switch the attached client to the next session.

no need to change your tmux.conf

Ctrl-b Shift-9 and Ctrl-b Shift-0

You can also do tmux switch -t <session name or number> or C-b ) for forward or C-b ( for forward nice ref: https://tmuxcheatsheet.com/