From 96f835b78b442a1c828908525550442854a7e859 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 26 Sep 2023 07:52:22 -0700 Subject: [PATCH] core: shift does not send mouse events Fixes #542 --- src/Surface.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Surface.zig b/src/Surface.zig index d64147f0d..10185bf41 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -1478,7 +1478,10 @@ pub fn mouseButtonCallback( { self.renderer_state.mutex.lock(); defer self.renderer_state.mutex.unlock(); - if (self.io.terminal.flags.mouse_event != .none) { + if (self.io.terminal.flags.mouse_event != .none) report: { + // Shift overrides mouse "grabbing" in the window, taken from Kitty. + if (mods.shift) break :report; + // In any other mouse button scenario without shift pressed we // clear the selection since the underlying application can handle // that in any way (i.e. "scrolling").