Ctrl+b [ enter copy-mode → arrows/PgUp to scroll; q to exit
(in copy-mode: Space to start a selection, Enter to copy)
Ctrl+b ] paste what was copied
~/.tmux.conf (common settings):
set -g mouse on # mouse: selection, pane resize, scroll
set -g history-limit 10000 # scrollback length
setw -g mode-keys vi # vi navigation in copy-mode
From a script: tmux new -d -s job 'long-cmd' (run in the background),
tmux send-keys -t job 'cmd' Enter.
| Option |
What it does |
Example |
-s name |
Name the session on creation — easier to find than by number. |
tmux new -s work |
-t name |
Target a session for attach, kill-session, send-keys. |
tmux attach -t work |
-l ls |
List running sessions. |
tmux ls |
-d |
Create the session already detached — for launching tasks from scripts. |
tmux new -d -s job 'long-running-command' |
send-keys |
Send keystrokes to a session without attaching to it (for automation). |
tmux send-keys -t job 'cmd' Enter |
Nothing found. Try a shorter query.