feat(terminal): on-screen Esc/Tab/Ctrl/arrow keys for phone keyboards (#117) - #120
Merged
Merged
Conversation
…#117) Gboard has no Esc, Tab, Ctrl or arrow keys, so a terminal tab on a phone could not autocomplete, walk history or send Ctrl+C. A row of seven keys now sits under the pane on touch devices (pointer: coarse); desktops do not see it. - Each key sends the same {type:'input'} frame a keystroke produces, through _reviveTerminal, so a tap on a half-dead pane reconnects. - Arrows honour DECCKM (SS3 under application cursor mode); Ctrl+arrow sends CSI 1;5 X. - Ctrl is one-shot: it applies to the NEXT key, typed on the phone keyboard (via term.onData) or tapped in the row, then releases. - A tap never takes focus: the action runs on pointerdown with its default prevented and touchstart is cancelled, or Gboard would close per key. test/terminal-keys.test.js runs the real block in a vm. 'Tab' joins the keycap allowlist of the i18n markup scan next to Ctrl and Esc. Fixes #117 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #117.
What
A row
Esc · Tab · Ctrl · ← · ↓ · ↑ · →under the terminal pane, shown only on touch devices (@media (pointer: coarse)). Desktop layouts are unchanged.{type:'input'}frame as a keystroke, through_reviveTerminal(), so a tap on a half-dead pane reconnects instead of being lost. Works on agent terminals and the engine pane.ESC [ Anormally,ESC O Awhen the TUI switched on application cursor mode. Ctrl+arrow →ESC [1;5 X.term.onData) or tapped in the row, then releases.aria-pressedshows the armed state.pointerdownwith the default prevented, andtouchstartis cancelled (non-passive). A focused button would close Gboard on every key.Verification
npm test→ exit 0 (84 files). Newtest/terminal-keys.test.js(9 checks) runs the real block fromindex.htmlin avm.isMobile,hasTouch), real server,/ws/terminalmocked withpage.routeWebSocketto record frames:\x1b,\t,\x1b[A,\x1b[D, Ctrl then typedc→\x03, Ctrl + ↓ →\x1b[1;5B, then typedx→x(Ctrl released)xterm-helper-textareaNot done / risk
🤖 Generated with Claude Code