Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion sources/PTYSession/PTYSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -17115,24 +17115,40 @@ - (VT100GridRange)screenRangeOfVisibleLines {

- (void)screenSetPointerShape:(NSString *)pointerShape {
NSDictionary *cursors = @{
@"X_cursor": ^{ return [NSCursor arrowCursor]; },
@"X_cursor": ^{ return [NSCursor operationNotAllowedCursor]; },
@"arrow": ^{ return[NSCursor arrowCursor]; },
@"based_arrow_down": ^{ return[NSCursor resizeDownCursor]; },
@"based_arrow_up": ^{ return[NSCursor resizeUpCursor]; },
@"cross": ^{ return[NSCursor crosshairCursor]; },
@"cross_reverse": ^{ return[NSCursor crosshairCursor]; },
@"crosshair": ^{ return[NSCursor crosshairCursor]; },
@"fleur": ^{ return[NSCursor openHandCursor]; },
@"hand1": ^{ return[NSCursor pointingHandCursor]; },
@"hand2": ^{ return[NSCursor pointingHandCursor]; },
@"left_ptr": ^{ return[NSCursor arrowCursor]; },
@"left_side": ^{ return[NSCursor resizeLeftCursor]; },
@"minus": ^{
if (@available(macOS 15.0, *)) {
return [NSCursor zoomOutCursor];
} else {
return [NSCursor crosshairCursor];
}
},
@"plus": ^{
if (@available(macOS 15.0, *)) {
return [NSCursor zoomInCursor];
} else {
return [NSCursor crosshairCursor];
}
},
@"right_side": ^{ return[NSCursor resizeRightCursor]; },
@"sb_h_double_arrow": ^{ return[NSCursor resizeLeftRightCursor]; },
@"sb_left_arrow": ^{ return[NSCursor resizeLeftCursor]; },
@"sb_right_arrow": ^{ return[NSCursor resizeRightCursor]; },
@"sb_up_arrow": ^{ return[NSCursor resizeUpCursor]; },
@"sb_v_double_arrow": ^{ return[NSCursor resizeUpDownCursor]; },
@"tcross": ^{ return[NSCursor crosshairCursor]; },
@"watch": ^{ return[NSCursor arrowCursor]; },
@"xterm": ^{ return [iTermMouseCursor mouseCursorOfType:iTermMouseCursorTypeIBeam]; },
};
NSCursor *(^f)(void) = cursors[pointerShape];
Expand Down
8 changes: 7 additions & 1 deletion sources/TerminalView/PTYTextView+ARC.m
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,13 @@ - (BOOL)updateCursor:(NSEvent *)event action:(URLAction *)action {
changed = [self setCursor:[NSCursor arrowCursor]];
} else if ([_mouseHandler mouseReportingAllowedForEvent:event] &&
[_mouseHandler terminalWantsMouseReports]) {
changed = [self setCursor:[iTermMouseCursor mouseCursorOfType:iTermMouseCursorTypeIBeamWithCircle]];
// If the app explicitly requested a pointer shape via OSC 22, honor it
// even while mouse reporting is enabled: an app that sets pointer
// shapes is mouse-aware, and hover-driven shapes (e.g. Turbo Vision,
// vim mouse support) inherently require any-motion reporting. The
// IBeamWithCircle affordance remains the fallback when no shape was
// requested.
changed = [self setCursor:self.delegate.textViewDefaultPointer ?: [iTermMouseCursor mouseCursorOfType:iTermMouseCursorTypeIBeamWithCircle]];
} else if ([self contextMenu:_contextMenuHelper offscreenCommandLineForClickAt:event.locationInWindow]) {
changed = [self setCursor:[NSCursor arrowCursor]];
} else if ([self mouseIsOverButtonInEvent:event]) {
Expand Down