From 1aef1f0049da793fc7533a18b65ab47bddc2a264 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 8 Nov 2023 14:51:54 -0600 Subject: [PATCH] terminfo: add entries for focus reporting These sequences have been used "informally" forever, and until recently mode 1004 was included in Xterm's XM (enable mouse reporting) sequence. But as of ncurses 6.4 patch 20231028, focus reporting mode is removed from XM and added to new fe and fd capabilities. Xterm also includes definitions for the actual focus events ("kxIN" and "kxOUT"), so include those too. --- src/terminfo/ghostty.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/terminfo/ghostty.zig b/src/terminfo/ghostty.zig index 515878378..92eb8bea1 100644 --- a/src/terminfo/ghostty.zig +++ b/src/terminfo/ghostty.zig @@ -151,6 +151,12 @@ pub const ghostty: Source = .{ .{ .name = "clear", .value = .{ .string = "\\E[H\\E[2J" } }, .{ .name = "E3", .value = .{ .string = "\\E[3J" } }, + // Focus reporting. Introduced in ncurses 6.4-20231028 + .{ .name = "fe", .value = .{ .string = "\\E[?1004h" } }, + .{ .name = "fd", .value = .{ .string = "\\E[?1004l" } }, + .{ .name = "kxIN", .value = .{ .string = "\\E[I" } }, + .{ .name = "kxOUT", .value = .{ .string = "\\E[O" } }, + // These are all capabilities that should be pretty straightforward // and map to input sequences. .{ .name = "bel", .value = .{ .string = "^G" } },