Switch between sessions in tmux?

TmuxTmuxinator

Tmux Problem Overview


I'm relatively new to tmux and use it just for local development. In some tmux tutorials, a person will list out their tmux sessions in an enumerated list. There is yellow highlight typically. Does anyone know what I'm talking about and how to do it? Secondly, would you say this is best practice? I'm over here with 8 iTerm2 tabs open :(

Here's a screenshot of what I'm looking for:

enter image description here

Tmux Solutions


Solution 1 - Tmux

CTRL-b s

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

Solution 2 - Tmux

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

Solution 3 - Tmux

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

Solution 4 - Tmux

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

Solution 5 - Tmux

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

Solution 6 - Tmux

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.

Solution 7 - Tmux

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

Solution 8 - Tmux

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/

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioniamnotsamView Question on Stackoverflow
Solution 1 - TmuxiamnotsamView Answer on Stackoverflow
Solution 2 - TmuxalexgolecView Answer on Stackoverflow
Solution 3 - TmuxwilcusView Answer on Stackoverflow
Solution 4 - TmuxFurkan SiddiquiView Answer on Stackoverflow
Solution 5 - TmuxYaserView Answer on Stackoverflow
Solution 6 - TmuxUlrich AnhaltView Answer on Stackoverflow
Solution 7 - TmuxZhang BuzzView Answer on Stackoverflow
Solution 8 - TmuxCharlie ParkerView Answer on Stackoverflow