cd /news/developer-tools/tmux-cheat-sheet · home topics developer-tools article
[ARTICLE · art-9682] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

tmux Cheat Sheet

The article provides a cheat sheet for using the terminal multiplexer tmux, including commands to start sessions, manage windows and panes, and select text using modifier keys. It also explains how to configure tmux through the `~/.tmux.conf` file, such as changing the default prefix key and enabling mouse support on macOS.

read1 min views27 publishedSep 16, 2016

Table of Contents #

Start a tmux session with tmux #

Select text in a tmux window with your mouse by holding the SHIFT key (Windows) or theOPTIONS key (Mac) and then using the mouse as you'd normally do Start a new tmux session with tmux before running the script! tmux new-session -d -s session1 tmux rename-window 'my window'

tmux send-keys 'echo "pane 1"' C-m
tmux select-window -t session1:0
tmux split-window -h
tmux send-keys 'echo "pane 2"' C-m
tmux split-window -h
tmux send-keys 'echo "pane 3"' C-m
tmux setw -g monitor-activity on
tmux set -g visual-activity on
tmux select-layout even-horizontal
tmux select-window -t session:1
tmux -2 attach-session -t cflogs

You can configure tmux via the ~/.tmux.conf file. After making changes to the config file, you can update the configuration "on-the-fly" with tmux source ~/.tmux.conf Use set -g prefix C-a to change the default prefix from CTRL

  • b to CTRL
  • a . Optionally you can "free" the default binding with unbind C-b You can add / alter tmux's key bindings with the following command bind | split-window -h this binds the split window -h command to the | key. In order to have mouse support in Mac OS X, you can add the following lines to your config file:
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
── more in #developer-tools 4 stories · sorted by recency
── more on @tmux 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/tmux-cheat-sheet] indexed:0 read:1min 2016-09-16 ·