This commit is contained in:
Mitchell Hashimoto
2023-10-11 22:01:37 -07:00
parent 392da475e1
commit f94f32be79
4 changed files with 48 additions and 3 deletions

View File

@@ -1519,7 +1519,11 @@ fn mouseShiftCapture(self: *const Surface, lock: bool) bool {
// If thet terminal explicitly requests it then we always allow it
// since we processed never/always at this point.
if (self.io.terminal.flags.mouse_shift_capture) return true;
switch (self.io.terminal.flags.mouse_shift_capture) {
.false => return false,
.true => return true,
.null => {},
}
// Otherwise, go with the user's preference
return switch (self.config.mouse_shift_capture) {

View File

@@ -106,7 +106,7 @@ flags: packed struct {
/// Set via the XTSHIFTESCAPE sequence. If true (XTSHIFTESCAPE = 1)
/// then we want to capture the shift key for the mouse protocol
/// if the configuration allows it.
mouse_shift_capture: bool = false,
mouse_shift_capture: enum { null, false, true } = .null,
} = .{},
/// The event types that can be reported for mouse-related activities.

View File

@@ -1522,7 +1522,7 @@ const StreamHandler = struct {
}
pub fn setMouseShiftCapture(self: *StreamHandler, v: bool) !void {
self.terminal.flags.mouse_shift_capture = v;
self.terminal.flags.mouse_shift_capture = if (v) .true else .false;
}
pub fn setAttribute(self: *StreamHandler, attr: terminal.Attribute) !void {