Skip to content

feat: double-tap CTRL/ALT on the mobile key bar to lock it - #21

Open
zarv1k wants to merge 1 commit into
cloudcli-ai:mainfrom
zarv1k:feat/keybar-modifier-lock
Open

zarv1k wants to merge 1 commit into
cloudcli-ai:mainfrom
zarv1k:feat/keybar-modifier-lock

Conversation

@zarv1k

@zarv1k zarv1k commented Oct 2, 2026

Copy link
Copy Markdown

Summary

The key bar's CTRL and ALT apply to the next character and then release. That cannot express a chord that repeats — most notably Claude Code's double Ctrl+C to exit, where the second ^C has to arrive within a second; re-arming CTRL between the two does not fit in that window.

A second tap within 500 ms of arming a modifier now locks it: the button gets a ring, and the modifier applies to every following character until the button is tapped again. A single tap behaves exactly as before.

  • The logic lives in TerminalSession.tapModifier(), next to the existing pendingCtrl / pendingAlt state; handleInput() only clears a modifier that is not locked.
  • The double-tap window only counts a tap that armed the modifier, so "CTRL, c, CTRL, d" typed quickly gives ^C ^D instead of locking by accident.
  • README and the button titles mention the double tap.

Testing

  • npm run typecheck and npm run build pass.
  • Mounted the plugin in headless Chromium with touch emulation and a stub WebSocket, typing into xterm's textarea:
    • tap CTRL, c → ^C, then c → c (released);
    • double-tap CTRL, c c → ^C^C, still locked; tap CTRL, c → c (released);
    • tap CTRL, d, tap CTRL, d quickly → ^D^D, not locked;
    • two taps 700 ms apart → off, not locked;
    • double-tap ALT, b f → ESC b ESC f.
  • Checked on an iPhone (installed PWA): double Ctrl+C exits Claude Code.
  • npm test: resize reaches the PTY and a dropped connection keeps the shell alive… fail on unmodified main too in my environment (Debian 13, Node 24). This change only touches the frontend.

These three mobile PRs and #18 touch nearby code but merge together without conflicts in any order.

The key bar's CTRL and ALT apply to one character and then release. That
cannot express a chord that repeats, such as Claude Code's double Ctrl+C
to exit: the second ^C has to arrive within a second, and re-arming CTRL
between the two does not fit in that window.

A second tap within 500 ms of arming a modifier now locks it - shown with
a ring - and it then applies to every character until it is tapped again.
A single tap still behaves as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant