Skip to content

Instantly share code, notes, and snippets.

@bparry02
Last active June 16, 2023 16:52
Show Gist options
  • Select an option

  • Save bparry02/118d526ed1972d447e439d61935e0cc5 to your computer and use it in GitHub Desktop.

Select an option

Save bparry02/118d526ed1972d447e439d61935e0cc5 to your computer and use it in GitHub Desktop.
Some helpful tmux commands

Tmux Commands

Scrollback

  1. PREFIX + [

    1. then Ctrl-s for forward search or

    2. Ctrl-r for reverse search

  1. tmux set-option -g history-limit 5000 \; new-session

Synchronize panes

  1. PREFIX + :

    1. set synchronize-panes on

    2. set synchronize-panes off

Sessions

  1. PREFIX + ( : Switch the attached client to the previous session.

  2. PREFIX + ) : Switch attached client to the next session.

  3. PREFIX + s : Select session from a list of sessions for the attached client interactively.

  1. Navigate to the target tmux session

  2. PREFIX + :move-window -s <session_num>:<window number>

  1. Navigate to the pane you want to move, so that it is in focus in the source window

  2. Navigate to the target window

  3. PREFIX + :move-pane -s <session_num>:<window number> -t <target session_num>:<window number>

Fix SSH Agent

  1. Show the new SSH_AUTH_SOCK environment variable: tmux show-env

  2. Overwrite the env var: eval SSH_AUTH_SOCK=/tmp/ssh-abcdef/agent.1234

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