this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(parser): parse CSI Z as shift+tab

authored by

Jose Ramirez and committed by
Tim Culverhouse
41fff922 a3ae1d53

+23
+23
src/Parser.zig
··· 403 403 .n = sequence.len, 404 404 }; 405 405 }, 406 + 'Z' => { 407 + // Legacy keys 408 + // CSI Z 409 + return .{ 410 + .event = .{ .key_press = .{ 411 + .codepoint = Key.tab, 412 + .mods = .{ .shift = true }, 413 + } }, 414 + .n = sequence.len, 415 + }; 416 + }, 406 417 '~' => { 407 418 // Legacy keys 408 419 // CSI number ~ ··· 852 863 const expected_event: Event = .{ .key_press = expected_key }; 853 864 854 865 try testing.expectEqual(6, result.n); 866 + try testing.expectEqual(expected_event, result.event); 867 + } 868 + 869 + test "parse: xterm shift+tab" { 870 + const alloc = testing.allocator_instance.allocator(); 871 + const input = "\x1b[Z"; 872 + var parser: Parser = .{}; 873 + const result = try parser.parse(input, alloc); 874 + const expected_key: Key = .{ .codepoint = Key.tab, .mods = .{ .shift = true } }; 875 + const expected_event: Event = .{ .key_press = expected_key }; 876 + 877 + try testing.expectEqual(3, result.n); 855 878 try testing.expectEqual(expected_event, result.event); 856 879 } 857 880