DebugPointer
Published on

Switch Tmux sessions

Switch Tmux sessions

Tmux is one of the most useful tool when it comes to using using a linux terminal.

Tmux is a terminal multiplexer, it allows a user to access multiple terminals (or windows), each running a separate program, while providing a single screen to work on. Tmux is useful for running more than one command-line program at the same time, increasing productivity and the way you work.

Let's look at multiple ways to switch tmux session.

Switch tmux session - keyboard shortcuts

Using Ctrl-B + s

To switch a tmux session, you have to just use the following keyboard shortcuts.

Ctrl-B + s

It's a series of 2 keyboard keysets you will have to press. You have to press Ctrl-B, then release the keys, then press s right after that.

Using Ctrl-B + ( or )

You can also use the keyboard shortcuts to go forward and back between sessions-

Ctrl-B + )

and

Ctrl-B + (

It's a series of 2 keyboard keysets you will have to press. You have to press Ctrl-B, then release the keys, then press ( or `) right after that.

Switch tmux session - command

You can also run the tmux command in the command line to switch the session-

tmux switch -t <session-name or number>

Once you are switch between the sessions, you can detach in case you want to quit from tmux session completely.

You can also switch pane, switch window or move panes to left or right to organize the way you want.

I hope you found this article useful, glad that you found it easy to switch sessions in Tmux. You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.