ctermdocs HomeBlogSign in

The terminal and the prompt box

Every Claude session in cterm is Claude Code's own terminal program, and the terminal pane shows it exactly as it draws itself. Under the rich pane sits the prompt box, where you write to Claude with completion for commands and files, attach images, recall earlier prompts and stop a turn. This page covers both, and the controls around them: compact and clear, retry and running commands.

What it is for

The rich pane is for reading; the terminal is the truth. When Claude Code shows something no card covers, an unusual dialog, a picker or its own status, you open the terminal and see the real screen. Everything you type there goes straight to Claude Code. The prompt box is for the everyday case: writing a prompt comfortably, especially on a phone, without the terminal's keyboard rules.

How to use it

Open the terminal

Press Cmd/Ctrl+J to show or hide the terminal pane beside the rich one, or choose Terminal in the session's row menu. It also opens by itself when Claude waits on a dialog that no card answers. Click into it and a keys go to the terminal badge confirms that your keystrokes now reach Claude Code, including Ctrl+K, Ctrl+N and the rest of its own shortcuts.

In the terminal pane:

  • Cmd/Ctrl+F opens Find in terminal: Enter for the next match, Shift+Enter for the previous, Esc to close.
  • Cmd/Ctrl+C copies a selection (with nothing selected it sends ^C), and Cmd/Ctrl+V pastes.
  • With text selected, an Ask about this button in the corner quotes it into the prompt box.
  • Fit and Fixed in the head choose whether the terminal follows the pane's size or keeps a set number of columns and rows and scrolls; click the size to change it.

On a phone the terminal is a page of its own: swipe left, or tap Terminal in the head's Chat | Terminal tabs. A row of keys under it gives you Esc, Tab, Shift+Tab, the arrows, Enter and ^C, which a soft keyboard lacks, and a keyboard button to type.

The terminal on a phone, with Chat and Terminal tabs in the head and the row of extra keys at the bottom.The terminal on a phone, with Chat and Terminal tabs in the head and the row of extra keys at the bottom.
The terminal on a phone, with Chat and Terminal tabs in the head and the row of extra keys at the bottom. ui-restyle-dark-phone-term.png and ui-restyle-light-phone-term.png, drawn by ui-shots.mjs

Open a shell

Shell beside New session in the sidebar starts a login shell in the folder shown below it. A shell session is the terminal alone, with no rich pane or prompt box; it lives on the same PTY host as the Claude sessions, so it survives a daemon restart and can be reopened from any device.

Write a prompt

Type in the box and press Enter to send; Shift+Enter starts a new line. On a touch screen Enter makes a new line and the Send button (the arrow at the right of the box) sends. What you type and do not send stays with that session in this browser from the first key, so you can switch sessions, reload the page or close the tab and come back to your draft. A quote from Ask about this, or text the brief puts in the box, joins the draft of the session it came from and no other. If the browser refuses to keep a copy (its storage is full, or a private window), the box says so above the text: what you wrote then lives in the box only until the tab closes.

The box is one line high until your text needs more, with its tools on that same line, so the conversation keeps the room. As soon as the text runs past one line it takes the box's whole width, the tools move to a row under it, and the box grows up to about 40% of the window before it scrolls inside itself. The keys the box takes and the app's main shortcuts (Cmd/Ctrl+K to jump to a session, N for a new one, Cmd/Ctrl+I for an idea) are in the Send button's tooltip: hold the pointer over it. H, pressed outside the box, opens the sheet of every shortcut (Keyboard shortcuts).

The prompt box grown to three lines: the text across the whole width, attach, / and @ at the left under it, the send-later clock and Send at the right.The prompt box grown to three lines: the text across the whole width, attach, / and @ at the left under it, the send-later clock and Send at the right.
The prompt box grown to three lines: the text across the whole width, attach, / and @ at the left under it, the send-later clock and Send at the right. ui-restyle-light-prompt-grown.png and ui-restyle-dark-prompt-grown.png, drawn by ui-shots.mjs
  • Type / at the start for the session's slash commands, with their descriptions, including skills and plugin commands. Arrow keys move, Enter or Tab picks, Esc closes the list.
  • Type @ for a file picker over the project folder and the session's scratchpad.
  • Press ↑ in an empty box to step back through the prompts you sent in this session, and ↓ to come forward.
  • The clock-with-an-arrow button at the left of the box opens its history: the last 50 texts you sent from this browser and the drafts you left in the box (a session switched away from, text you wiped without sending), newest first, each marked sent or draft. A click puts it back in the box, and what was there goes to the history as a draft, so nothing you wrote is lost on the way.
The prompt box's history open over the box: the texts sent and a draft, newest first, each with when.The prompt box's history open over the box: the texts sent and a draft, newest first, each with when.
The prompt box's history open over the box: the texts sent and a draft, newest first, each with when. ui-box-history-light.png and ui-box-history-dark.png, drawn by outbox-shot.mjs

The / and @ buttons at the left of the box insert the same characters; on a phone they sit behind the +.

Attach files and images

Paste an image, drop files anywhere on the session, or use the paperclip. Each file uploads to the session's uploads folder and shows as a chip, and a short placeholder such as [image 1] marks its place in your text. When you send, the placeholder becomes the file's full path, so Claude reads the file from where you mentioned it. The × on a chip removes it and its placeholder.

An attachment opens before you send it. Click a chip's thumbnail or tag, or reach it with Tab and press Enter, and the file opens in the viewer as it would from a sent message: a screenshot at full size, a CSV as a table, a workbook with its sheets, a PDF with its pages. Your text and every chip stay as they are. Close the viewer with Esc, its × or a click beside it, and the cursor is back in the box where you left it; select a passage in the viewer and Ask about this puts it quoted after what you wrote, with the attachment still attached. A chip still uploading, or whose upload failed, opens nothing, and its tooltip says why. This works in the session's own pane and in the session dialog a session link opens; the dock's small chat, the master view's chat panel and the desk's box have no viewer, so their chips only show the file's path.

A drop does not have to hit the box: the chat, the terminal and the session's head take it too, and so does a session's chat in the dock or on the master view. While you drag files over the session, a dashed line goes around it and the box lights up; let go and the files land in the box together, with the cursor in the text. The files drawer and the idea palette keep their own drops: a file dropped there goes to the folder or the idea, not the prompt. Dropped anywhere else in the app, a file does nothing, where the browser used to open it in the tab.

Send while Claude works

You do not have to wait for a turn to end. A prompt sent while Claude works is queued by Claude Code itself; the pane shows it with queued · Claude has not read it yet until Claude takes it in, either at its next step or when the turn ends.

Edit a message still queued

Sent something and spotted a mistake? While it is still queued you can change it, as Claude Code's own terminal lets you. Press ↑ in the empty prompt box to take back your newest queued message, or click Edit on the queued bubble you want. cterm takes the message out of Claude's queue before Claude reads it, puts its text in the prompt box and marks the bubble as being edited; once it is out, the bubble leaves the chat. Change what you need and send: Claude gets the new text only, as one message. Your other queued messages stay queued, once each. The turn Claude is running goes on all the while.

A queued message waits for the step Claude is running to finish, which can be seconds or minutes. If Claude reads it before cterm can take it back, nothing changes in Claude's input: the bubble turns plain as usual, the box tells you Claude already read it, and the text you were editing stays there to send as a new message if it still needs saying. With nothing queued, ↑ brings back your earlier prompts, as before. Edit is only on your own messages: not on a scheduled prompt, a task notification or another session's message.

A queued message being edited: its bubble marked as being taken back from Claude's queue, and its text in the prompt box, ready to change.A queued message being edited: its bubble marked as being taken back from Claude's queue, and its text in the prompt box, ready to change.
A queued message being edited: its bubble marked as being taken back from Claude's queue, and its text in the prompt box, ready to change. ui-queued-edit-dark.png and ui-queued-edit-light.png, drawn by queued-edit-shot.mjs

A prompt is yours until cterm has it

When you press Send the box empties at once, but your prompt is not handed off blindly: this browser keeps it until the Mac says it has it. It shows in the chat as your bubble, marked Sending…, then Pending · cterm has it while cterm types it into Claude; once Claude has it, the mark goes and your bubble stays as usual. On a good connection this takes a moment and you barely see the mark.

When the connection is down (a laptop asleep, a phone out of signal) the bubble reads Pending · waiting for the connection and goes by itself once the page reaches the Mac again, with nothing for you to do. If the page gets no answer for a prompt within a few seconds, it takes the connection for dead, opens a new one at once and sends the prompt again; cterm types each prompt once, however many copies arrive. If the second try gets no answer either, the bubble turns Not sent, with its whole text, Retry, Edit (back into the box), Copy and Discard. A prompt still on its way when you reload the page or close the tab is there when you come back, and sent once.

A prompt marked Not sent after two connections gave no answer, its whole text, and Retry, Edit, Copy and Discard.A prompt marked Not sent after two connections gave no answer, its whole text, and Retry, Edit, Copy and Discard.
A prompt marked Not sent after two connections gave no answer, its whole text, and Retry, Edit, Copy and Discard. ui-outbox-dark.png and ui-outbox-light.png, drawn by outbox-shot.mjs

The Mac also keeps the text of every prompt it received from the page, in a file per session that only your macOS account can read, so a prompt can be found there whatever happened in the browser.

When a message does not reach Claude

Now and then Claude does not take a message: it is busy elsewhere, or stops responding for a while. cterm waits for Claude to read the keys it typed and never types your message twice into a Claude that has not reacted yet. When it gives up, your message stays in the chat, marked Not sent, with a line saying why and where its text is now. When cterm typed it into Claude's input box and it is still there, cterm takes it out, so the next message is not added after it. If Claude only stopped responding, the line says it may still take the message; if it does, the mark goes away by itself.

Under it, Retry has cterm type it again (the message reads Sending again… until Claude takes it), Edit puts it in the prompt box to change it and send it yourself (the mark stays until you do), Copy puts its text on the clipboard, and Discard drops it, leaving it dimmed in the chat. An ended session offers Edit, Copy and Discard: sending from the box resumes it. Someone who only watches the session sees the message without the buttons. cterm keeps these messages until it restarts.

Stop a turn

While Claude works, the box shows Stop (the square beside Send), which sends Esc to the session, exactly as pressing Esc in the terminal would. The turn ends where it is. Cmd/Ctrl+. does the same from the keyboard, from the prompt box too.

Compact or clear the context

Click the context chip in the head (ctx 84%) or use the row menu:

  • Compact: Claude replaces the conversation with a summary.
  • Compact with a focus…: you say what the summary must keep; it is sent as /compact with your words.
  • Clear…: Claude starts the conversation over. cterm asks first; the session keeps its name, marks and brief, and the transcript stays on disk.

Picked while Claude is working, the command waits for the turn to end, shown on the chip, with Cancel until it goes. The pane marks the point with a "Context compacted" or "Conversation cleared" line.

Retry a failed turn

When a turn fails on an API error, the line under it offers Retry, which sends the same prompt again. After a usage limit it also offers the other models (the session restarts on the one you pick, then sends the prompt) and, when the error names the reset time, Retry at that time, which cterm keeps even with the tab closed. A waiting retry shows with Cancel.

You rarely need those for a usage limit: when a turn stops on one and the error names its reset, cterm sends the prompt again by itself a minute after that time, with the tab closed or the daemon restarted meanwhile. A reset named as a time of day that has just begun, or passed less than five minutes ago, counts as today's, so the prompt goes about a minute later instead of the next day. It goes sooner when the login has room again: a status line shows another window (you logged in to another account, or the window reset), or another session on the same login and model finishes a turn without an error. The line under the failed turn says when it will go, with Cancel. When several sessions of one login wait, they go one at a time a few seconds apart, and if the first one hits the limit again the rest wait for the reset it names. A prompt you send to the session meanwhile, typed or scheduled, takes its place. A prompt that was scheduled for much earlier goes with a line saying when it was due, so Claude can judge whether it still applies. An overload is never retried by itself. To keep Retry a click only, turn off Retry a usage limit by itself in the project's Settings tab (Task sessions section), or run cterm project set <owner>/<project> limitRetry off.

A task session on a roadmap item does not wait for you there: when its turn, the kickoff included, stops on a usage limit, cterm restarts it once on the project's executing model (the one picked for the item's executor, else the preset's for its size, else Opus) and sends the same prompt again. A line under the failed turn says so, and the model chip is tagged fallback. An overload or any other error stays failed with the Retry line as above, and a limit on that fallback too waits for its reset like any other session's.

Run a command Claude suggested

Every code block has Copy. For admins, a shell block in Claude's answer, or a one-line block that reads as a command, also has Run on their own sessions. In a task session with a worktree it asks where to run it first. The output appears in a card under the answer, with its colours, the exit code and the time, Stop while it runs, Copy output, Run again (which asks before repeating) and Send to Claude, which quotes the output into the prompt box for you to send.

How it works

The PTY host owns each session's pseudo-terminal and keeps a screen of it with its scrollback. When you open the terminal pane, the browser gets that screen and then the live bytes, unchanged, drawn by xterm.js; the browser acknowledges what it has drawn, so a slow connection cannot flood it. Keys you type go back as the same bytes.

The prompt box hands your text to the page's outbox (outbox.ts), kept in this browser's storage with an id until the daemon answers that it has it (prompt-receipts.ts, which also appends the text to ~/.cterm/prompts/ and types an id only once); no answer within a few seconds closes the connection and sends it again on a new one. The daemon types it into Claude's input rather than pasting it, so it reaches the model as your own words; prompt-delivery.ts waits for Claude to be at its prompt and reports whether the prompt landed, was queued or failed. Claude Code's prompt hook then puts your bubble in the pane. A prompt that never landed is kept by the daemon and shown as not sent (UndeliveredCard.tsx); while the screen shows nothing new since the keys went, Claude has not read them and nothing is typed again. Stop is an Esc key sent the same way. Compact and clear are /compact and /clear typed at the next idle moment (context-op.ts); a timed retry is held by the daemon (retry.ts), and so is the retry it arms itself after a usage limit, which limit-retry.ts lets go one session of a login at a time, watching the login's usage from the sessions' status lines. A command you run is started by the daemon in the project folder or the worktree, and its output is streamed to the card; Claude does not see it unless you send it.

Scenarios

A dialog the pane cannot answer

Claude Code shows a choice that no card covers. The terminal pane opens by itself beside the chat; you read the real screen, pick with the arrow keys and Enter, and press Cmd+J to hide the pane again.

A screenshot and a follow-up

You paste a screenshot of a broken layout and write "the footer overlaps here: [image 1]". While Claude reads the CSS you remember something and send "keep the mobile breakpoint as it is"; it shows as queued and Claude picks it up at its next step.

Out of usage at the worst time

A long refactor stops with a usage limit until 12:15. You go to a meeting; at 12:16 cterm sends the prompt again by itself. Had you logged in to another account in one of the sessions, the status line would have shown its fresh window and the waiting sessions would have gone right away, one after another. Later, at 84% context, you choose Compact with a focus… and ask it to keep the decisions on the API.

Screenshots on this page are drawn by docs/spike/ui-shots.mjs, docs/spike/outbox-shot.mjs, docs/spike/queued-edit-shot.mjs from fake data, and refreshed when a view changes.

Written in docs/site/pages/terminal-and-prompt.md and built by docs/site/build.mjs.