Skip to content

Add Super (macOS Cmd) modifier support across keyboard protocols - #11

Closed
alganet wants to merge 2 commits into
mainfrom
editor-keys
Closed

Add Super (macOS Cmd) modifier support across keyboard protocols#11
alganet wants to merge 2 commits into
mainfrom
editor-keys

Conversation

@alganet

@alganet alganet commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Generalize the legacy VT modifier resolver from hard-coded params 1-8 to a numeric bitmask computation that also decodes the xterm meta bit (params 9-16), surfacing the macOS Cmd key as the super- prefix so event names match the kitty protocol's Cmd mapping. Extract a shared _tuish_bits_prefix helper so the modifier vocabulary and ordering live in one place for both the VT and kitty resolvers.

Wire macOS motions into the editor example (Cmd line/document, Option word, Cmd+Shift / Option+Shift selection) and document the VT meta-bit behaviour, including the portability limits when terminals map Cmd onto Ctrl or reserve it for their own menus.

alganet added 2 commits April 22, 2026 14:43
On zsh (macOS Terminal.app, Zed), the rAF input-peek used
`read -t0` twice — which on zsh consumes a byte on the first call,
silently discarding the ESC that opens the next SS3 sequence. The
remaining O/C bytes then fired as character events, inserting stray
letters during arrow key repeat.

Two independent failure paths fixed:
- Add shell-specific `_tuish_peek_byte` (one call on zsh, two on bash)
  and use it in both `tuish_has_pending_input` and the rAF check.
- Set `_tuish_raf_inhibit` around dispatch in the ESC-within-escape
  path so the inner loop retains ownership of the bytes it still needs.

Regression test added: three right arrows sent with no inter-byte gap
verify cursor lands at Col 4 and text is unchanged.
Generalize the legacy VT modifier resolver from hard-coded params 1-8 to
a numeric bitmask computation that also decodes the xterm meta bit
(params 9-16), surfacing the macOS Cmd key as the super- prefix so event
names match the kitty protocol's Cmd mapping. Extract a shared
_tuish_bits_prefix helper so the modifier vocabulary and ordering live in
one place for both the VT and kitty resolvers.

Wire macOS motions into the editor example (Cmd line/document, Option
word, Cmd+Shift / Option+Shift selection) and document the VT meta-bit
behaviour, including the portability limits when terminals map Cmd onto
Ctrl or reserve it for their own menus.
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