From d1273bbd99daf9b1855d82bf315db8ede20abde5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 3 Nov 2026 16:52:58 -0300 Subject: fs: a pane's ctl read ends with its mode (mode:normal|insert|select|tty, select being normal mode extending), and kbdin takes Plan 9's Kalt, Kshift and Kctl runes (U+F015-F017), each adding its modifier to the key after it, an Alt or Ctrl key typing no text: the two surfaces the behavioural tests' inventory found most wanted (90 tests read body.mode, 18 send Alt or Shift); the tests that pinned the ctl line's end look for its words instead Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/behaviour/panes.zig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/behaviour/panes.zig') diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig index 45b7152c..01820a07 100644 --- a/test/behaviour/panes.zig +++ b/test/behaviour/panes.zig @@ -8,7 +8,18 @@ test "panes: a collapsed pane's ctl says so" { const first = try s.focused(); _ = try s.newPane(); try s.write(s.at("/pane/{d}/ctl", .{first}), "Collapse\n"); - try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " collapsed ")); + try std.testing.expect(std.mem.indexOf(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " collapsed ") != null); +} + +test "panes: a pane's ctl read ends with its mode, as its tag's box shows it" { + var s = try Session.initFile(std.testing.allocator, "x\n"); + defer s.deinit(); + const ctl = s.at("/pane/{d}/ctl", .{try s.focused()}); + try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:normal ")); + try s.keys("i"); + try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:insert ")); + try s.keys("\x1bv"); + try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:select ")); } test "panes: the ctl word name refuses a leading blank, as the name file does" { -- cgit v1.3