- Desktop and web terminals use the text-input path too, so IMEs, dead
keys, the emoji picker and dictation work; the key handler still
encodes special keys and chords first (handled keys are never typed
again), composing text is drawn at the cursor and sent on commit, the
platform editable sits at the cursor, and a closed input reopens on
the next key. The editable terminal is a semantics text field so web
typing also works with semantics on.
- Web: "Capture browser keys" (terminal menu and right-click menu) goes
full screen and calls navigator.keyboard.lock(); hold Esc to leave.
No-op where unsupported; cheatsheet and menu note give alternatives.
- Touch: scrollable key row with sticky Ctrl/Alt (tap once, double-tap
lock), Esc, Tab, arrows, Home/End, PgUp/PgDn and symbols through the
hardware encoder; soft keyboard types per key (delete detection,
Return as Enter); the line field moves behind the row's Line button.
- Capture kit: compose=, --semantics false, --user-agent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Colours: terminal background is the theme's lowest surface; the 16 ANSI
colours come from a chosen palette (Theme colours, Classic, Calm, Vivid;
Settings > Terminal > Colours, saved as `palette`) adjusted in lightness
to the background: colours 4.5:1, bright ones lighter than normal,
white light and black dark in both themes so white-on-red/blue/magenta
and black-on-green/yellow/cyan (ls setuid, setgid, sticky) keep 3:1.
Selection, find matches and the current match keep text at 4.5:1.
- Bottom panel opens at 40% of the window, at least 16 rows, until
dragged; the dragged height is remembered (old saved 300 px default
reads as never resized).
- Navigation rail scrolls its tabs (and below 240 px Settings too), so
items never overlap under a tall panel.
- Chat command cards: Expand / Collapse grows a live terminal to 60% of
the window (finished output only to its rows); collapsed stays 12 rows.
- Terminal tabs: ellipsised titles (220 px) with the whole title in the
tooltip, selected tab filled, outlined and bold, close buttons are
IconButtons (48 px touch, 40 px desktop).
- Capture fixture: ?terminalColors=1 and ?terminalPalette=.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved keeping both sides: main's active-client rules, input
lane, reply marking and key input, and this branch's flow control,
acknowledgements, subscriptions and sliced emulator feed. terminal_ack
joins the terminal lane; the feed marks each live slice it writes as
drawing, so the emulator's answers still go to onReply.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Machine terminals no longer skip output for live viewers. Each connection's
subscription is a cursor into the 1 MiB retained tail, drained by the
connection's writer as soon as the PTY reader writes (no 50 ms tick; a
streaming frame gathers for at most 2 ms). A subscription opened with
flow: true gets window (256 KiB) in its reply and acknowledges drawn output
with terminal_ack; while one is full the reader stops reading the PTY, so
the program waits. A subscription full for 3 s without acking stops holding
the terminal and later sees a gap; a gone connection drops its
subscriptions. Clients that never ask for flow keep the old pacing (newest
64 KiB per 50 ms). terminal_open/terminal_output replies precede the frames
that follow them, which start exactly at the reply's output_end.
Chat shell runs share the buffer code: output is pushed as it arrives,
oldest first, while the chat's watchers keep short queues; 256 KiB unpushed
stops the reader, and watchers behind for 3 s get the old pacing.
The app asks for flow, takes offsets from the server (frame end, reply
output_end) instead of re-encoded text length, acks per quarter window, and
writes replays and bursts into the emulator in slices that yield to the
event loop (ChatShellTerminalFeed, shared with chat shells).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several clients drawing one terminal (machine terminal or chat terminal
command) no longer interfere. The server tracks, per terminal, the
connections drawing it, most recently active first: the active client
(the opener, then whoever last typed or focused it) owns the PTY size and
is the only one whose emulator's automatic query answers reach the
process; other clients' answers are acknowledged and dropped, and their
sizes recorded but not applied. When the active connection closes the next
most recent client's size is applied.
Protocol (backwards compatible; all new fields optional):
- terminal_input / chat_shell_input: reply (emulator answer), cols/rows
(the typist's size, applied before the input).
- terminal_resize / chat_shell_resize: activate (the client focused it).
Latency: PipelinesClient sends terminal_input, terminal_resize,
chat_shell_input and chat_shell_resize at once rather than behind the
previous request's reply. The server reads those onto a per-connection
terminal lane handled in order beside the ordinary request loop, and
terminal_open (up to 5 s waiting for su) now runs off the read loop.
Client: ChatShellTerminalSession routes what the emulator emits while
drawing output to onReply and reports focus through activate();
ChatShellInputPipe keeps answers and typing in separate requests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Live terminals no longer reflow (xterm.dart 4.0.0 left the cursor on the
wrong row); narrowing cuts and erases cells past the width, rows scroll
into scrollback keeping the cursor row; finished output still reflows.
- App-side key encoding before xterm.dart's defaults: Alt as Meta (ESC +
the typed character), Ctrl symbol table, xterm modifier parameter for
arrows/Home/End/PgUp/PgDn/Ins/Del/F-keys, DECCKM and DECKPAM, Alt+BS.
- Settings > Appearance > Terminal: Use Option as Meta key (Macs, on).
- Inside a focused terminal only Cmd+T and Ctrl+` toggle it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Date once per calendar day: a muted centred divider above each day's
first timed row (chatDayDividers); rows show only their time ("10:16"),
with the full date and time kept in the tooltip and semantics. The user's
time shares the delivery line; a harness notice's time trails its line.
- Activity line and turn chips are secondary: bodyMedium, regular weight,
onSurfaceVariant (error colour kept for failures), a small chevron_right
that turns down while its details are open (replaces expand_less).
- Copy / Read aloud: 18 px muted icons; on pointer devices shown only while
the reply is hovered or an action is focused (also without the gutter);
touch keeps them visible with a full tap target. The time leads the
footer so hidden actions leave no gap.
- Settled questions: the question on one line, the operator's answer in
full on its own line beneath it.
- Meta rows (activity, chips, notices, compaction line) start at the reply
text's leading edge; turn chips sit in their own column under the answer.
- Scroll fixture: ?timestamps=1 spreads messages over two days.
Row keys are unchanged; the divider joins a row without replacing it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On phones the chat's More menu, chat list rows and Files entries open a
Material bottom sheet headed by the chat or file, with full-width icon
rows and destructive actions last in the error colour; desktop menus
show icons, a minimum width and destructive actions after a divider.
The chat menu drops Run command and Open chats, keeps a single terminal
entry and lists Close pane last.
A browser keeps Ctrl+Shift+C for its developer tools, so on Linux and
Windows web nothing copied. With text selected Ctrl+C now copies it (and
clears the selection) instead of interrupting the process; Ctrl+Insert
copies too, and a finished run's read-only output answers the copy keys.
The terminal's options menu names the key.
A dialog only in the tiled app on a wide layout: a phone keeps its
full-screen page (run 304 had turned it into a sheet and rewritten the
tests), and a floating window opens it as a page of that window so a diff
or command output it opens stays in the window.
Present chat turn and shell-history detail surfaces through the shared adaptive popup helpers so desktop uses dialogs while phone layouts retain bottom sheets. Update focused tests and document the verified behavior.
On Android and iOS a tap on a terminal (a chat command card or the terminal
panel) now opens the soft keyboard and typing goes to the process, with no
autocorrect. Desktop keeps raw key events. Desktop keyboard tests now run
as macOS, since tests default to Android.
Dismissed shell runs leave the transcript and fold into a "N commands"
chip in the footer of the first answer at or after each run (the last
answer for newer runs, or a row of its own without any answer). The chip
opens the turn sheet (wide) or a full-screen page (narrow) listing the
commands; each opens its output read-only with Copy output, Send to agent
and Restore.
On a wide conversation the answer's Copy button moves out of the footer
into a 48 px gutter left of the reading column (chatCopyGutter), shown on
hover or focus on desktops and always on touch; narrow widths keep it in
the footer.
Finished command cards get a Dismiss button and the chat's More menu a
Dismiss all finished commands entry. Dismissal applies to every client of
the chat; a SnackBar (Material) or transient notice (Cupertino) offers Undo
for 5 s. Running commands cannot be dismissed until they end.
Finished terminals are sized synchronously from their rows at the view's
width (the post-frame fit made the transcript re-anchor forever); blank rows
xterm.dart keeps when rewrapping are dropped; desktop typing uses key events;
the composer leaves Cmd/Ctrl-V to a focused terminal; Ctrl-A reaches the
process. The probe fixture gains coloured terminal runs and an interactive
login. Notes record behaviour, protocol, security and verification.
The card's output area is now an xterm.dart emulator kept per run by the
controller: it is fed the raw stream in order, takes typing and paste while
the command runs (with a key toolbar and a soft-keyboard field on touch
platforms), resizes the process to its layout, opens printed links, shrinks
finished runs to their output and opens full screen. A reconnect resumes from
the byte the card holds; Copy output copies the server's plain text.
Show Expand only when output can overflow and drop the final newline from
the drawn output. The full-app probe lists shell runs with ?shell=1 so the
cards, Shell mode and Run command dialog can be captured in Chrome.
A draft starting with ! shows a Shell mode indicator and runs through
chat_shell_run instead of being sent to the agent; the chat's actions menu
gains Run command. Each run is a terminal-style card among the turns with
live output, Stop, its exit status, Copy output and Send to agent.