input: clarify why we use all mods for unicode CSI u

This commit is contained in:
Mitchell Hashimoto
2023-08-16 14:04:38 -07:00
parent dcf9cdd8bf
commit 2ff2e018ba

View File

@ -120,16 +120,17 @@ pub fn legacy(
// At this stage of key processing, we only need to apply fixterms // At this stage of key processing, we only need to apply fixterms
// to unicode codepoints if we have ctrl set. // to unicode codepoints if we have ctrl set.
if (self.event.mods.ctrl) { if (self.event.mods.ctrl) {
// Important: we want to use the original // Important: we want to use the original mods here, not the
const csi_u_mods = CsiUMods.fromInput(binding_mods); // effective mods. The fixterms spec states the shifted chars
// should be sent uppercase but Kitty changes that behavior
// so we'll send all the mods.
const csi_u_mods = CsiUMods.fromInput(self.event.mods);
const result = try std.fmt.bufPrint( const result = try std.fmt.bufPrint(
buf, buf,
"\x1B[{};{}u", "\x1B[{};{}u",
.{ utf8[0], csi_u_mods.seqInt() }, .{ utf8[0], csi_u_mods.seqInt() },
); );
// std.log.warn("CSI_U: {s}", .{result});
std.log.warn("CSI_U: {s}", .{result});
return result; return result;
} }