Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shortcuts

The full-screen panel runs when stdin and stdout are both a terminal. These are its keys. In the panel, /shortcuts or ? on an empty input shows them, so a message cannot start with a typed ?: type a space first, or paste it.

Session

KeysWhat it does
entersend the message
escinterrupt the turn
ctrl-cclear the input
ctrl-c ctrl-cquit
shift+tabcycle the mode
ctrl-gwrite in your editor
?these shortcuts (empty input)
/shortcutsthese shortcuts, as a command

During a turn

KeysWhat it does
entersteer, or ask on the side
tabsend it after the turn
escstop the turn
esc (side)stop only the side reply
↑edit a queued message (empty)

Moving

KeysWhat it does
← →a character
ctrl+← ctrl+→a word (alt+← alt+→ too)
alt-b alt-fa word back, forward
ctrl-a ctrl-ethe line’s start, end
home endthe input’s start, end
↑ ↓lines, then history

Editing

KeysWhat it does
ctrl-jnew line
alt+enternew line
shift+enternew line (if reported)
backspacedelete back
deletedelete forward
ctrl-wdelete the word before
ctrl-udelete to line start
ctrl-kdelete to line end
ctrl-oexpand collapsed pastes
KeysWhat it does
/commands (at the start)
@pick a file
↑ ↓move the highlight
tab enteraccept
escclose the menu

The plain prompt (piped input)

KeysWhat it does
ctrl-cinterrupt the turn; when idle, quit
ctrl-dquit (end of input)

Commands for the start screen, updates and leaving (the panel and the plain prompt):

TypeWhat it does
/noticeseverything the start did not print: attention, about this start, privacy, status
/updateinstall the newest release without leaving the session (esc cancels before the swap)
/restartswitch to the installed binary and keep the conversation; waits for the turn to end
/quit, /exitsave the session and leave (/exit is the same as /quit)
exit, quitthe same as /quit when harness is idle; during a turn, while /update runs or a harness update check is pending, they are an ordinary message
harness updatecaught when idle: offers /update instead [Y/n] (it is a terminal command)

The typed words match the whole line, ASCII case-insensitively, with nothing before them ( exit and exit now are messages). The harness update question answers only while the line is empty; any other key closes the question as no and is typed as usual (so /quit then Enter quits), and with text already typed keys go to the line (Esc still closes the question). A line queued (with Tab, or with Enter while /update or a check runs) is always a message, however it reads.

Some keys work only in some places:

  • Menus: typing @ opens the file picker; a / at the start opens the command menu. An open menu takes ↑/↓, Tab, Enter and Esc, and the first Esc closes it instead of interrupting.
  • Pickers: /model and /mode take every key and name their keys in their title rows. In /model and its thinking step, Enter switches and saves the choice as the default for new sessions; Tab switches for this session only (config.md). Ctrl-C always closes them.
  • Approvals: while an approval’s choices are on screen, only its own keys and Ctrl-C work. A typed reply uses the editing keys. The main agent’s questions and its sub-agents’ queue in one line, shown one at a time in the order asked. Esc answers the one on screen, as n does.
  • A long tool call: once a tool call has run for 2 seconds (time spent waiting at an approval does not count), Enter on a message asks it on the side, as well as steering it into the turn. A read-only side session answers from what the main agent knew when the call started. It can read and search files but never runs a command, asks for approval or changes a file. Its answer appears under the running call when it finishes and joins the conversation at the call’s end, without starting a turn. While the model is writing, with an approval open, or while a side reply is running, Enter steers as before. Tab queues the message for after the turn, as always. The status line hints the choice (enter asks on the side · tab after turn · esc stops).
  • Esc during a side reply stops only the side reply, and the message still joins the turn; a second Esc stops the turn. With the agent idle, Esc stops a running side reply together with the sub-agents.
  • Sub-agents: during a turn, Esc stops the turn and the sub-agents keep running. With the agent idle and no question on screen, Esc stops every sub-agent, including one still waiting to start (config.md).
  • Quitting with sub-agents running waits up to 10 seconds for them to stop; Ctrl-C leaves at once after the first half second.

When a key does not arrive

The panel sees only the keys your terminal sends. A terminal, tmux or screen can keep a key, or send a different one.

tmux and screen prefixes. A multiplexer takes its prefix key first. With the tmux prefix on C-a, Ctrl-A (start of line) reaches the harness only when pressed twice, given bind C-a send-prefix in ~/.tmux.conf. GNU screen’s default prefix is also C-a; C-a a sends a literal Ctrl-A. For any key a tmux or screen binding owns, rebind it there or use another key for the same action.

Esc and Alt in tmux. After an Esc, tmux waits escape-time for an Alt sequence (500 ms by default, per the tmux 3.4 man page), so Esc can feel slow. set -sg escape-time 10 shortens the wait.

Shift+Enter. Most terminals send it as plain Enter. It gives a new line only where the terminal reports the Shift, and under tmux only if tmux forwards it (extended-keys). Ctrl-J always gives a new line; Alt+Enter usually does.

macOS terminals. Reported by users and vendor docs; not checked on a Mac.

  • Ghostty, and iTerm2 with its “Natural Text Editing” preset, send Cmd+←/→ as Ctrl-A/Ctrl-E and Option+←/→ as Esc-b/Esc-f, which the harness reads as Alt-b/Alt-f. Under tmux, Cmd+←’s Ctrl-A is subject to the prefix note.
  • Terminal.app sends neither by default; set the keys in Settings → Profiles → Keyboard.
  • Alt-b/Alt-f need Option to act as Alt: macos-option-as-alt = true in Ghostty, or “Esc+” for the Option key in iTerm2’s profile keys. Otherwise Option types a character (∫, ƒ).

The plain prompt. When stdin or stdout is not a terminal, the harness reads whole lines and the terminal, if any, does the editing. The harness handles only Ctrl-C and end of input; /shortcuts there says so.