Terminal: text input for IMEs, Capture browser keys, touch key row

- 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>
This commit is contained in:
2026-11-26 02:43:57 +00:00
parent e526150b1e
commit c5af000453
36 changed files with 1730 additions and 173 deletions
+8 -4
View File
@@ -25,8 +25,10 @@ emulator. Auth flows that print a link, wait for a pasted token and continue
Cmd-V on Apple platforms, Ctrl-V or Ctrl-Shift-V elsewhere, plus the
toolbar's Paste button. Ctrl-A and other Ctrl keys reach the process. A key
toolbar under the terminal: Paste, Enter, Ctrl-C, Tab, Esc, arrows. On
Android/iOS the toolbar also has a text field ("Type input, then Enter")
for the soft keyboard, with a Hide typing toggle; it is emptied when sent.
Android/iOS it is the touch key row (sticky Ctrl/Alt, Esc, Tab, arrows,
Home/End, PgUp/PgDn, symbols) and typing goes to the terminal key by
key; its Line button opens a text field ("Type input, then Enter") with
a Hide typing toggle, emptied when sent.
- The terminal is resized to its layout (debounced 150 ms); the process gets
SIGWINCH. New runs start at the last laid-out size. A live terminal does
not reflow (xterm.dart's reflow left the cursor on another line's row, so
@@ -125,8 +127,10 @@ emulator. Auth flows that print a link, wait for a pasted token and continue
assumes AltGr arrives as Ctrl+Alt or its own key; a Mac's Option as Meta
takes the character from the logical key, else the US position of the
physical key, so a non-US Mac layout's Option+key may send the US letter.
- Desktop typing uses key events (no IME composition for CJK input). Touch
platforms use the field.
- Desktop typing uses the text input as well as key events (2026-11-26,
see `terminal-panel.md` "Text input"): IMEs, dead keys, the emoji picker
and dictation work; touch platforms type key by key into the terminal,
with a touch key row and the line field behind its Line button.
- A descendant that keeps the PTY open after the command exits is read for
1 s; on macOS the PTY has no read deadline, so its reader goroutine ends
only when that descendant closes it (the run itself is finished and the