Add Super (macOS Cmd) modifier support across keyboard protocols - #11
Closed
alganet wants to merge 2 commits into
Closed
Add Super (macOS Cmd) modifier support across keyboard protocols#11alganet wants to merge 2 commits into
alganet wants to merge 2 commits into
Conversation
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.
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.
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.