Skip to content

Instantly share code, notes, and snippets.

@ekruten
Last active November 26, 2021 08:01
Show Gist options
  • Save ekruten/e35b5160aec35e21c89138ab64357aff to your computer and use it in GitHub Desktop.
Save ekruten/e35b5160aec35e21c89138ab64357aff to your computer and use it in GitHub Desktop.
Tmux cheat sheet

Install

brew install tmux

Sessions

Create session 0

tmux

Create session with name my-session The name of session is displayed in square brackets at the bottom-left corner

tmux new -s my-session

Session list:

tmux ls

Select a new session for the attached client interactively:

<C-b s>

Attach:

tmux attach -t my-session

Detach:

<C-b d>

or

tmux detach

Windows

Create new window:

<C-b c>

Next window: <C-b n>

Previous window: <C-b p>

To the window with number 2: <C-b 2>


Close window:

<C-b x>

or

exit

Panes

The window could be splitted into panes.

Split horizontally:

<C-b ">

or

tmux split-window -h

Split vertically:

<C-b %>

or

tmux split-window -v

Switch between panes:

<C-b Left>

Change pane size:

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