macos: treat unfocused split modifiers as UI state#12710
Open
rockorager wants to merge 1 commit into
Open
Conversation
The terminal controller listens for flagsChanged events so all splits can keep modifier-sensitive UI state current. Forwarding those events through SurfaceView.flagsChanged() also routes them through the normal key input path, so an unfocused split can receive modifier press and release events as terminal input. Send modifier changes for unfocused splits through a modifier-only surface entry point instead. The core surface updates mouse modifier state, link highlighting and cursor shape from that path, but does not run key binding or terminal encoding. Apply key remaps there as well so focused and unfocused modifier state stay consistent. Factor the shared modifier and mouse-shape work into helpers so the normal key path and the modifier-only path use the same state transitions. Keep the physical-key filter in keyToMouseShape(), and expose the pure modsToMouseShape() calculation for cases where AppKit reports only a modifier state change. To reproduce the old behavior: open two splits in Ghostty and run `kitten show-key -m kitty` in each. Modifier key presses appear in both splits. AI Disclosure: This patch was prepared with the help of AI.
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.
The terminal controller listens for flagsChanged events so all splits can keep modifier-sensitive UI state current. Forwarding those events through SurfaceView.flagsChanged() also routes them through the normal key input path, so an unfocused split can receive modifier press and release events as terminal input.
Send modifier changes for unfocused splits through a modifier-only surface entry point instead. The core surface updates mouse modifier state, link highlighting and cursor shape from that path, but does not run key binding or terminal encoding. Apply key remaps there as well so focused and unfocused modifier state stay consistent.
Factor the shared modifier and mouse-shape work into helpers so the normal key path and the modifier-only path use the same state transitions. Keep the physical-key filter in keyToMouseShape(), and expose the pure modsToMouseShape() calculation for cases where AppKit reports only a modifier state change.
To reproduce the old behavior: open two splits in Ghostty and run
kitten show-key -m kittyin each. Modifier key presses appear in both splits.AI Disclosure: This patch was prepared with the help of AI.