Skip to content

Instantly share code, notes, and snippets.

@sys0dm1n
Last active January 25, 2019 08:09
Show Gist options
  • Save sys0dm1n/ed982b3c35e3bbb5155ed13fe8506111 to your computer and use it in GitHub Desktop.
Save sys0dm1n/ed982b3c35e3bbb5155ed13fe8506111 to your computer and use it in GitHub Desktop.

To begin a new tmux session:

tmux

To split into two panes:

Ctrl-b %

To split the pane horizontally:

Ctrl-b "

To switch to the next pane (panes are numbered left-to-right, top-down):

Ctrl-b o

To create a new window:

Ctrl-b c

tmux will switch to the new window automatically. You can see the new window indicated in the status-line. Windows are numbered from 0, so our new window is number 1.

Now you can create panes and treat this window like we did before. We can even create another window. Our three windows are numbered 0, 1, and 2.

To move to the next window in the index:

Ctrl-b n

To move backwards in the index:

Ctrl-b p

To detach from a session:

Ctrl-b d

To re-attach to a session:

tmux attach -t [session name]

Sessions, like windows, are numbered beginning from 0. If you forgot which session you wanted to attach to, you can view active sessions:

tmux list-sessions

Enable synchronize-panes:

ctrl+b 

then

shift :set synchronize-panes on 

To disable synchronization:

ctrl+b 

then

set synchronize-panes off

A list of all command keys is accessible with:

Ctrl-b ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment