terminal: parse and handle set modify key format (ESC[>{a};{b}m)

This commit is contained in:
Mitchell Hashimoto
2023-08-12 22:27:46 -07:00
parent d94474463b
commit 66aa1d9be3
6 changed files with 92 additions and 18 deletions

View File

@@ -1183,6 +1183,17 @@ const StreamHandler = struct {
self.terminal.setScrollingRegion(top, bot);
}
pub fn setModifyKeyFormat(self: *StreamHandler, format: terminal.ModifyKeyFormat) !void {
self.terminal.modes.modify_other_keys = false;
switch (format) {
.other_keys => |v| switch (v) {
.numeric => self.terminal.modes.modify_other_keys = true,
else => {},
},
else => {},
}
}
pub fn setMode(self: *StreamHandler, mode: terminal.Mode, enabled: bool) !void {
// Note: this function doesn't need to grab the render state or
// terminal locks because it is only called from process() which