Skip to content

Instantly share code, notes, and snippets.

@Nifled
Last active February 21, 2024 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nifled/d7ea414253ae2259c37620d5922eaef0 to your computer and use it in GitHub Desktop.
Save Nifled/d7ea414253ae2259c37620d5922eaef0 to your computer and use it in GitHub Desktop.
-----------------
TMUX CHEATSHEET
-----------------
Prefix for commands and help:
Ctrl-b and sth: issue a command to tmux, inside tmux.
Ctrl-b and ?: see all commands.
-------------------------------------------------------------------
Session commands:
-------------------------------------------------------------------
tmux: creates a new session and enters it.
tmux new -s sessionname: creates a session with the specified name.
tmux ls: lists all sessions.
Ctrl-b and d: detach current session.
Ctrl-b and D: detach selected session (interactive).
tmux attach-session -t sessionNameOrNumber: attach to target session.
tmux rename-session -t sessionNameOrNumber newName: renames sess.
//to get rid of a session: Prefix and then `:` and type `kill-session`, then hit Enter.
-------------------------------------------------------------------
Window commands:
-------------------------------------------------------------------
Ctrl-b and c: create a window.
Ctrl-b and w: choose a window from a list.
Ctrl-b and <number>: switch to window <number>.
Ctrl-b and p: switch to previous window (acc. to bottom bar).
Ctrl-b and n: switch to next window (acc. to bottom bar).
Ctrl-b , : Rename current window.
-------------------------------------------------------------------
Pane commands:
-------------------------------------------------------------------
Ctrl-d OR exit: kills the current pane, without asking for confirmation.
Ctrl-b and x: quit. closes current pane after asking for confirmation.
Ctrl-b and %: vertically splits the window into two panes.
Ctrl-b and ": horizontally splits the window into two panes.
Ctrl-b and o: traverses panes.
Ctrl-b and <arrow keys="">: traverses panes.
Ctrl-b and ; : switches back and forth btw. the last two panes.
Ctrl-b z: make pane temporarily go full screen - go back to normal size.
Ctrl-b Ctrl-<arrowkey>: resize pane in a certain direction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment