diff --git a/src/Surface.zig b/src/Surface.zig index 40b6a2f90..6d694ea3e 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -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 diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index b89e9a64c..5fc3c6c1f 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -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 = {} });