mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
mouse: set mouse to text when bypassing mouse reporting
When shift is held, we are bypassing mouse reporting mode. Change the cursor to text to indicate this to the user. On release, change back to whatever we were before.
This commit is contained in:

committed by
Mitchell Hashimoto

parent
c96cedcf22
commit
9a64697433
@ -1121,6 +1121,17 @@ pub fn keyCallback(
|
||||
self.hideMouse();
|
||||
}
|
||||
|
||||
if (self.io.terminal.flags.mouse_event != .none and
|
||||
event.physical_key == .left_shift or
|
||||
event.physical_key == .right_shift)
|
||||
{
|
||||
switch (event.action) {
|
||||
.press => try self.rt_surface.setMouseShape(.text),
|
||||
.release => try self.rt_surface.setMouseShape(self.io.terminal.mouse_shape),
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
|
||||
// No binding, so we have to perform an encoding task. This
|
||||
// may still result in no encoding. Under different modes and
|
||||
// inputs there are many keybindings that result in no encoding
|
||||
|
@ -2024,6 +2024,7 @@ const StreamHandler = struct {
|
||||
self: *StreamHandler,
|
||||
shape: terminal.MouseShape,
|
||||
) !void {
|
||||
self.terminal.mouse_shape = shape;
|
||||
_ = self.ev.surface_mailbox.push(.{
|
||||
.set_mouse_shape = shape,
|
||||
}, .{ .forever = {} });
|
||||
|
Reference in New Issue
Block a user