Honor OSC 22 pointer shapes while mouse reporting is enabled#700
Open
cklukas wants to merge 1 commit into
Open
Honor OSC 22 pointer shapes while mouse reporting is enabled#700cklukas wants to merge 1 commit into
cklukas wants to merge 1 commit into
Conversation
updateCursor: previously forced the IBeamWithCircle cursor whenever the app had mouse reporting on, so OSC 22 shapes never displayed exactly when mouse-aware apps need them. Prefer the app-requested shape and keep IBeamWithCircle as the fallback. Also add missing shape names (fleur, watch, plus, minus) and map X_cursor to operationNotAllowedCursor.
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.
Summary
Applications can set the mouse pointer shape with OSC 22 (kitty pointer-shape protocol), which iTerm2 parses and stores. However,
-[PTYTextView updateCursor:action:]short-circuits to the IBeamWithCircle cursor whenever the app has mouse reporting enabled and never consults the stored shape, which is only reached in the finalelsebranch. Since hover-dependent pointer shapes require any-motion reporting (DECSET 1003) to detect hovering in the first place, the feature could never be seen exactly when mouse-aware applications need it: the requested shape only appeared once the application disabled mouse reporting.Changes
PTYTextView+ARC.m,updateCursor:action:: in the mouse-reporting branch, prefer the app-requested pointer(
self.delegate.textViewDefaultPointer) and keep IBeamWithCircle as the fallback when no shape was requested. The IBeamWithCircle cursor exists to tell the user that mouse input is being sent to the running application.An application that requests a pointer shape via OSC 22 clearly handles mouse input already, so that hint is unnecessary and the requested pointer can be shown instead. Behavior with no OSC 22 shape set is unchanged.
PTYSession.m,screenSetPointerShape:: add missing X cursor font names from the kitty spec —fleur(open hand),watch(arrow),plus/minus(zoom in/out) — and mapX_cursortooperationNotAllowedCursorinstead of the arrow. The zoom cursors are macOS 15 API, so they are@available(macOS 15.0, *)-guarded with a crosshair fallback to respect the 12.4 deployment target.Reproduction
Run inside iTerm2 and move the mouse pointer within the window:
Testing
1003 l; patched shows it immediately while 1003 is active.OSC 22 ;and disabling mouse reporting restore the default pointer.