summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 18:39:53 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitf99806de546c837ab6f2d5b1e3e8accc95e63a7e (patch)
tree9b4c70a524f36e1966cbfbedd2d85525a3de01b6 /src/gui
parent14dc0b452cf646fe5c9f060fbe66afb01f153ac0 (diff)
downloadpardes-f99806de546c837ab6f2d5b1e3e8accc95e63a7e.tar.gz
pardes-f99806de546c837ab6f2d5b1e3e8accc95e63a7e.zip
Over a program that tracks the mouse, B2 and B3 are pardes's execute and look, as in any pane, and Shift sends them to the program as its buttons 2 and 3; B1 and the wheel stay the program's, Shift keeping them pardes's
The Shift that sends B2 or B3 is left out of their reports and of the drags they hold: it only chose the target. A B2 or B3 sweep of pardes's moves nothing to the program under 1003. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.zig12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 1e58d3ba..ea0e2862 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -5042,7 +5042,7 @@ test "a wheel's notch is whole lines, a touchpad's fraction is not" {
try std.testing.expectEqual(@as(?i32, null), notchOf(std.math.nan(f32), 1));
}
-test "a click over codex in a terminal reaches its pty with its modifiers; with Shift it is pardes's" {
+test "a click over codex in a terminal reaches its pty with its modifiers; Shift swaps B1 to pardes and B2 to the program" {
if (comptime !pardes.panes.terminal.enabled) return error.SkipZigTest;
const gpa = std.testing.allocator;
const core = try pardes.Pardes.init(gpa, .{ .cols = 60, .rows = 16, .tty_only = true });
@@ -5077,9 +5077,17 @@ test "a click over codex in a terminal reaches its pty with its modifiers; with
try std.testing.expectEqualStrings("\x1b[<32;7;4M", try take(core, &sent));
in.post(.{ .mouse = pointerMouse(.left, .release, next, .{}) });
try std.testing.expectEqualStrings("\x1b[<0;7;4m", try take(core, &sent));
+ // Shift-B1 is pardes's select; B2 is pardes's execute and Shift-B2
+ // the program's, reported without the Shift.
+ in.post(.{ .mouse = pointerMouse(.left, .press, mc, .{ .shift = true }) });
+ in.post(.{ .mouse = pointerMouse(.left, .release, mc, .{ .shift = true }) });
+ try std.testing.expectEqualStrings("", try take(core, &sent));
+ in.post(.{ .mouse = pointerMouse(.middle, .press, mc, .{}) });
+ in.post(.{ .mouse = pointerMouse(.middle, .release, mc, .{}) });
+ try std.testing.expectEqualStrings("", try take(core, &sent));
in.post(.{ .mouse = pointerMouse(.middle, .press, mc, .{ .shift = true }) });
in.post(.{ .mouse = pointerMouse(.middle, .release, mc, .{ .shift = true }) });
- try std.testing.expectEqualStrings("", try take(core, &sent));
+ try std.testing.expectEqualStrings("\x1b[<1;6;4M\x1b[<1;6;4m", try take(core, &sent));
}
test "a wheel over codex in a terminal reaches its pty as the mouse reports it asked for" {