Interface & Shortcuts
Interactive pw code runs in a full-screen terminal interface: a scrollable transcript on top, the message composer at the bottom, and a status line showing the current model, allocation, and token usage. This page covers the interface elements and every keyboard shortcut.
At rest, the bottom of the screen looks like this:
The Transcript
- Streaming markdown: Responses stream in as the model generates them and are rendered as formatted markdown, including highlighted code blocks.
- Syntax-highlighted diffs: File edits are shown as diffs with syntax highlighting on the changed lines.
- Repo banner: The startup banner includes the repository name and current branch when the workspace is a git repository.
- Collapsible blocks: Long tool outputs collapse to a summary line; press Ctrl+O to expand or collapse the most recent one.
- Jump to bottom: When you scroll up, a centered Jump to bottom (ctrl+end) ↓ pill appears; new output stops following until you return to the tail (or press Ctrl+R to re-enable following).
- Search: Press Ctrl+F and type to search the transcript; matches are highlighted, Enter/↓ and ↑ step between them, and Esc closes the search.
The mouse wheel always scrolls the transcript. Clicking on interface elements is off by default; enable the Mouse clicks option in /settings if you want clicks to select picker rows and toggle blocks.
Keyboard Shortcuts
Press ? at an empty prompt to toggle the shortcuts overlay in the session itself.
| Key | Action |
|---|---|
| Enter | Send the message. While the agent is working, the message is queued and sent automatically when the turn ends. |
| Shift+Enter | Insert a newline (Alt+Enter or Ctrl+J on terminals that cannot distinguish it). |
| ↑ / ↓ | Recall earlier prompts, including from previous sessions in the same workspace. While the agent is working, ↑ at an empty prompt pulls back your newest queued message for editing. |
| ↓ (past the newest entry) | Move the cursor into the agent switcher when subagents are running. See Subagents for the switcher's own keys. |
| Esc | Close an open overlay; interrupt the running turn or ! command. At the prompt, press once to arm and again to clear the typed text. |
| Ctrl+C | Interrupt the running turn; with text typed, clear the composer. At an empty prompt, press twice to quit. |
| Ctrl+D | Quit (at an empty prompt). |
| Shift+Tab | Cycle the permission mode: read-only → accept-edits → bypass-permissions → plan. |
| ? | Toggle the shortcuts overlay (at an empty prompt). |
| / | Open the slash command palette. |
| @ | Open the file picker to reference a file. |
| ! | Enter shell mode (see below). |
| Ctrl+O | Expand or collapse the most recent collapsible block. |
| Ctrl+R | Toggle whether the transcript follows new output. In the model picker: refresh the model list. |
| Ctrl+F | Search the transcript. |
| Ctrl+V | Paste: attaches a clipboard image when one is present, otherwise pastes text. |
| Ctrl+L | Clear and redraw the screen. |
| PgUp / PgDn | Scroll the transcript half a screen. |
| Ctrl+Home / Ctrl+End | Jump to the top / bottom of the transcript while scrolled. |
Interrupting a turn restores your last message to the composer so you can edit and resend it. If you had messages queued, they are discarded instead, with a notice.
Shell Mode
Start a message with ! to run a shell command yourself, without involving the model. The composer's prompt glyph switches to ! and a hint appears: enter runs it locally; output is added to the conversation.
The command runs in your login shell in the workspace directory. Because you typed it yourself, it bypasses the agent's permission system entirely. The command and its output are recorded into the conversation as context, so the agent can refer to them on its next turn, but running a ! command does not start a model turn; the agent only sees the output the next time you send it a message.
Press Esc to interrupt a running command. Commands are limited to two minutes; a hung command is killed rather than freezing the session.
File References
Type @ followed by part of a file name to open the file picker, which fuzzy-matches against the workspace's files as you type. Use ↑/↓ to move, and Tab or Enter to insert the highlighted path. Selecting a directory keeps the picker open on that directory's contents so you can browse inward. Path-like queries such as @~/Downloads/ or @../ browse the filesystem directly, including outside the workspace.
When your message is sent:
- Text files referenced with
@have their contents included with your message (workspace files only). The transcript shows just the@reference you typed. - Image paths (
.png,.jpg,.jpeg,.gif,.webp) are attached as images the model can see. These may point outside the workspace, e.g.@~/Downloads/screenshot.png.
Pasting Images
Press Ctrl+V to paste an image from the clipboard. The image is attached and an [Image #1] placeholder is inserted into your message; deleting the placeholder before sending drops the attachment. If the model rejects image input, pw code tells you so you can remove the image or switch to a vision-capable model with /model.
Over SSH
Inside an SSH session your local clipboard is unreachable, and pw code will say so. Copy the file to the remote machine (e.g. with scp) and attach it with @path instead.
Related Documentation
- pw code Overview: Feature overview and quick start
- Slash Commands: The
/command palette - Permissions: What the permission modes mean
- Subagents: The agent switcher and delegated tasks
- Sessions & Resume: The session picker
- Settings: Auto-scroll, mouse clicks, and other preferences
- Models & Allocations: The model picker