learntmux.dev

Run commands from the command prompt

Goal

Session learn has a window logs that is not current, and a window running top.

C-b : opens the command prompt in place of the status line. Type a tmux command, Enter runs it, Escape cancels. Do not type tmux in front — you are already talking to it.

C-b c is just new-window with no flags. The prompt is where you add them:

-d
create the window without switching to it
-n name
name it, instead of letting it take its program’s name
a word after the flags
a program to run in place of the shell

Most commands have a short alias: new-window is neww, new-session is new, list-keys is lsk.

Do this

Press C-b :, type neww -d -n logs, Enter.

The list reads 0:shell* 1:logs — the new window exists but shell stays current.

Press C-b :, type neww top, Enter.

A window running top opens and becomes current: 2:top*.

What the prompt does with output

Flags work as in the shell, and ; separates several commands on one line. A short result shows on the status line; longer output opens in view mode, which q closes.

Stuck on this one?

This is a live terminal. Typing goes to the machine, including Tab. Press Shift and Tab together to move focus back out to the page.

A real terminal, in this tab

about 15 MB, once

session learn

Done when

not started
  1. Window logs exists in session learn and is not the current window— not done yet
  2. A window in session learn is running the top program— not done yet