Click the virtual machine below to start practicing
- Setting up virtual machine…
- Preparing lab files…
- Starting terminal services…
This lab machine has stopped
Your progress through the guide is saved. Start a fresh machine to keep practicing.
Click the virtual machine below to start practicing
Your progress through the guide is saved. Start a fresh machine to keep practicing.
From the last lab. Answer in your head, then open to check.
Ctrl-b [ enters copy mode; Ctrl-b ] pastes.?ERROR and press Enter.tmux reads ~/.tmux.conf when it starts. Most people change a few things on day one: an easier prefix and mouse support. Some also number windows from 1 to match the keyboard; others are happy counting from 0, like array indexes. Your call.
~/.tmux.conf isn't a special format: it's a list of ordinary tmux commands, run once when the server starts. A server that's already running never rereads it, which is why you load changes yourself with tmux source-file.
set -g sets an option globally, the default every session inherits. Changing the prefix to Ctrl-a doesn't remove the old binding, which is why unbind C-b is there too.
tmux new -s cfg
Create ~/.tmux.conf with these lines, using nano ~/.tmux.conf or any editor:
set -g prefix C-a
unbind C-b
bind C-a send-prefix
set -g mouse on
Line by line: make Ctrl-a the prefix, free up Ctrl-b, let Ctrl-a Ctrl-a send a real Ctrl-a to programs, and turn on the mouse.
Optional: windows are numbered from 0. If you'd rather start at 1 (so Ctrl-a 1 is the first window, matching the keyboard), add:
set -g base-index 1
If 0 suits you (arrays start at 0, after all), skip it.
A running tmux doesn't notice config changes. Load the file:
tmux source-file ~/.tmux.conf
Press Ctrl-a c to make a new window with the new prefix. Click a window's name in the status bar to switch to it with the mouse.
~/.tmux.conf is read when tmux starts.tmux source-file ~/.tmux.conf reloads it in a running tmux.prefix and mouse are the classic first changes; base-index 1 is a matter of taste.