diff --git a/src/Surface.zig b/src/Surface.zig index 6d694ea3e..d7329889b 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -1121,6 +1121,9 @@ pub fn keyCallback( self.hideMouse(); } + // When we are in the middle of a mouse event and we press shift, + // we change the mouse to a text shape so that selection appears + // possible. if (self.io.terminal.flags.mouse_event != .none and event.physical_key == .left_shift or event.physical_key == .right_shift) @@ -1128,7 +1131,7 @@ pub fn keyCallback( switch (event.action) { .press => try self.rt_surface.setMouseShape(.text), .release => try self.rt_surface.setMouseShape(self.io.terminal.mouse_shape), - else => {}, + .repeat => {}, } } diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index 256b4c9fe..cf3dbea71 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -85,6 +85,7 @@ previous_char: ?u21 = null, /// The modes that this terminal currently has active. modes: modes.ModeState = .{}, +/// The most recently set mouse shape for the terminal. mouse_shape: mouse_shape.MouseShape = .text, /// These are just a packed set of flags we may set on the terminal.