Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/Parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,17 @@ inline fn parseCsi(input: []const u8, text_buf: []u8) Result {
.n = sequence.len,
};
},
'Z' => {
// Legacy keys
// CSI Z
return .{
.event = .{ .key_press = .{
.codepoint = Key.tab,
.mods = .{ .shift = true },
} },
.n = sequence.len,
};
},
'~' => {
// Legacy keys
// CSI number ~
Expand Down Expand Up @@ -855,6 +866,18 @@ test "parse: xterm shift+up" {
try testing.expectEqual(expected_event, result.event);
}

test "parse: xterm shift+tab" {
const alloc = testing.allocator_instance.allocator();
const input = "\x1b[Z";
var parser: Parser = .{};
const result = try parser.parse(input, alloc);
const expected_key: Key = .{ .codepoint = Key.tab, .mods = .{ .shift = true } };
const expected_event: Event = .{ .key_press = expected_key };

try testing.expectEqual(3, result.n);
try testing.expectEqual(expected_event, result.event);
}

test "parse: xterm insert" {
const alloc = testing.allocator_instance.allocator();
const input = "\x1b[2~";
Expand Down
Loading