Repository navigation
feat(terminal): keyboard only from the key bar on a touch screen (opt-in) - #2966
Conversation
…-in) Settings > Terminal > Keyboard only from the key bar (off by default, a device setting): while the key bar's keyboard control reads Show, the input line and xterm's field carry inputmode=none, so a tap on the grid, the line, Send or a key focuses without raising the soft keyboard. Show removes the attribute inside its own tap; Hide, or the system putting the keyboard away, brings it back. Fixes #1635
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait...
|
…ard only from the key bar The hold followed the control's displayed direction, which falls back to the viewport measurement after its settle window. The measurement is blind to a floating keyboard or a zoomed page, so inputmode=none came back on the focused field and took the keyboard away. Hold on a per-pane request instead: Show sets it; Hide, a keyboard measured going down, or the focus leaving the pane's fields ends it.
… raise it Offline, held, ended or view only, the control is disabled or absent while the input line still takes a draft: with the setting on nothing could raise the keyboard there. The request now also ends when the focus lands outside the line and xterm's field, such as the find bar.
|
Review notes (omo + Codex Terra xhigh), for the merge pass. Two fix rounds after the first review:
The final re-review at head 1cd898c was CLEAR. These findings remain, all unreproduced, so none blocks the merge and none gets a follow-up issue:
Not checked: native iOS or Android keyboards. Chromium's scripted viewport stands in for the keyboard in the regression script. |
…connection comes back With Keyboard only from the key bar on, a tap into the line or the grid while the control cannot be pressed raises the keyboard itself. Record it as the request, so the reconnect does not put inputmode=none back on the field being typed in.
# Conflicts: # src/components/PaneTerminal.tsx # src/components/TerminalInput.tsx # src/lib/settings.legacy-fixture.ts # src/lib/settings.test.ts # src/lib/settings.ts
|
Final re-review at head 77c37e9 (omo + Codex Terra): no HIGH. As agreed with the lead, no further fix rounds. Remaining findings:
|
# Conflicts: # src/lib/settings.legacy-fixture.ts # src/lib/settings.ts
|
Local merge gate (owner-approved): origin/main merged (two settings key-list conflicts, both sides kept), |

Fixes #1635.
What
A new opt-in setting, Settings > Terminal > Keyboard only from the key bar (off by default, a device setting kept in its own storage key like the other recent opt-ins). With it on, on a touch screen:
inputmode="none". A tap on the grid, the line, Send or a key-bar key still focuses them as before, but the browser raises no soft keyboard.With it off (the default), nothing changes: no field gets
inputmode, except the existingnoneon xterm's field in Input line mode.The hold is
setting && coarse pointer && !requested.requestedis a per-pane state that the control's Show tap sets. Hide clears it, and so do a keyboard measured going down (the back gesture, throughlib/keyboardControl.ts's notifications) and the focus leaving the pane's fields. Nothing is held while the control cannot be pressed (offline, input not ready, held by another bridge, ended, view only). The line still takes a draft there, so a tap raises the keyboard as with the setting off (omo re-review). The focus-out check accepts only the line or xterm's field, not other fields in the pane such as the find bar. The hold is deliberately not the control's displayed direction: that falls back to the viewport measurement after its settle window, and the measurement is blind to an iPad floating keyboard or a zoomed page (Codex review). The line gets it as a prop. xterm's field gets it through its own layout effect inuseTerminalSends, separate from the mode-switch effect, so a re-hold never re-runs that effect's blur or handoff.Differences from the issue's proposal
Design reference: Termux's KEYBOARD extra key, the keyboard toggle of a phone terminal app. Reading is the rest state, and typing is asked for. DESIGN.md has the entry.
Tests
scripts/terminal-keyboard-demo-regression.ts: a newkeyboard-on-requestscenario on a 390-wide phone runs with the setting off and on, in line and direct mode. At rest, after a tap on the line or grid, after Show (inputmodechecked as the tap's own focus runs), with the keyboard up, after the system dismissal, after Hide, after an unmeasured Show outlives the settle window, and after the focus leaves the pane's fields, it checks the field'sinputmodeand focus. An offline step (the line still raises a keyboard for a draft) was added in the second round. Each review step fails without its fix; the unmeasured step fails with (an unmeasured keyboard Show raised is not taken back). Failing first: with thesrc/change stashed, it fails aton, line: at rest the field raises no keyboard(actualnull, expected"none"). With the change, the whole script passes, including every existing scenario.src/lib/settings.test.ts: the default, sanitising, device scope, and the setting's own key surviving an old tab's whole-record save.Screenshots
Settings > Terminal at 390 and 1280, in light and dark, were checked by eye with the row off and on. The row sits right after Key bar and uses the same Toggle as its neighbours. Nothing else changes visually.
Validation
bun run check fast: pass (on the merged head, via the heavy runner).bun scripts/terminal-keyboard-demo-regression.ts: pass.bun test src/lib/settings.test.ts: pass.inputmode="none"is the platforms' documented way to suppress the soft keyboard (Chrome on Android, Safari on iOS).