Repository navigation
surface: restore application mouse shape after modifier overrides - #14128
Merged
Merged
Conversation
hard-coded .default & .text overrode a previously set OSC22 pointer shape, this was a regression introduced in 6e8ed4e.
Update the tests to expect the mouse_shape back, not the hardcoded .default or .text
I think this is the expected behavoir when a custom OSC22 pointer is set. Once shift is released it will return to mouse_shape (whatever the pointer was before shit held).
Contributor
Author
|
Simple test on main, printf '\e]22;pointer\a' , will turn the mouse pointer finger, hold shift will turn I-beam, release, it should turn back to the pointer finger but doesn't, subsequent printf '\e]22;pointer\a' will also fail to set the pointer. On this fix it will reset back to the OSC22 set pointer. |
Contributor
|
@j-c-m thanks for catching this. I'm just going to piggyback on your commit here to just simplify some things; I think the whole "state machine" thing that I was envisioning didn't necessarily materialize, so I'm just going to update some of the code to reflect. Otherwise looks good! |
keyToMouseShape was initially designed with more of a transition table model in mind to handle key presses/overrides based on very specific cursor states. This never materialized, so I think it's safe to just simply the process of handling overrides and/or passing along the current cursor state from the terminal in the event of key presses. Also removed a test that is essentially a duplicate of one before it now (returning current surface shape in the event of no overrides).
vancluever
force-pushed
the
surface/mouse-shape-osc22
branch
from
September 3, 2026 02:03
7054f73 to
0fb6d29
Compare
vancluever
approved these changes
Sep 3, 2026
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.
This fixes a regression of 9a64697 introduced in 6e8ed4e.
With this fix the mouse pointer will be restored to the previous (which could have be set to something else via OSC22), not a hardcoded .text or .default.
It also will change the cursor to a text selection if shift is held even without mouse tracking, I think this is the expected behavior when a cursor is set via OSC22. (Kitty additionaly, once you start selecting changes to text (I-beam), this would be a follow-up if we desire to behave like kitty with OSC22 pointers).