Skip to content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

1 Tmux CheatSheet


PRs Welcome

File me Issues or star this repo.

1.1 Tmux Basic

Create new sessiontmux new -s denny
List all sessionstmux ls
Attach to one sessiontmux attach -t denny
Detach sessionC-b d
Kill one sessiontmux kill-session -t denny
List all shortcut keysC-b :list-keys, C-b ? Very useful!
Kill current windowC-b &
Default conf file~/.tmux.conf, ~/.tmate.conf

1.2 Tmux Layout & Scroll

Switch to next paneC-b o
Vertically split paneC-b %
Horizontally split paneC-b ”
Kill current paneC-b x
Swap two panesC-b C-o
Resize current pane rightC-b :resize-pane -R 20
Resize current pane downC-b :resize-pane -D 10

1.3 Tmux Console Output

Enter copy modeC-b [, press q/Esc to exit
Search outputC-b C-s, C-b C-u
Paste buffer to current panelC-b]
Page up/downEnter copy mode, then use normal navigation keys
Show things in current buffertmux show-buffer
List all buffertmux list-buffers
Save buffer to filetmux save-buffer foo.txt

1.4 Tmate

see tmate log messages: ssh conn stringtmate show-messages
Launch tmate in a detached statetmate -S /tmp/tmate.sock new-session -d
Blocks until the SSH connection is establishedtmate -S /tmp/tmate.sock wait tmate-ready
Prints tmate SSH connection stringtmate -S /tmp/tmate.sock display -p ‘#{tmate_ssh}’
Make your tmate session big by defaultMake your default iterm window big

1.5 Scripts

  • Copy to mac clipboard

Note: Only works for the laptop who hosts the tmux/tmate session

brew install reattach-to-user-namespace

# In tmux, search a region. Then save to pbcopy
tmux save-buffer - | reattach-to-user-namespace pbcopy

# In mac terminal

1.6 More Resources

License: Code is licensed under MIT License.

linkedin github slack
You can’t perform that action at this time.