diff --git a/src/terminal/osc.zig b/src/terminal/osc.zig index 33d753c9f..10ba5b5e7 100644 --- a/src/terminal/osc.zig +++ b/src/terminal/osc.zig @@ -178,6 +178,9 @@ pub const Command = union(enum) { progress: ?u8 = null, }, + /// Wait input (OSC 9;5) + wait_input: void, + pub const ColorKind = union(enum) { palette: u8, foreground, @@ -811,6 +814,11 @@ pub const Parser = struct { '4' => { self.state = .conemu_progress_prestate; }, + '5' => { + self.state = .swallow; + self.command = .{ .wait_input = {} }; + self.complete = true; + }, // Todo: parse out other ConEmu operating system commands. // Even if we don't support them we probably don't want @@ -2096,6 +2104,30 @@ test "OSC: OSC9 progress pause with progress" { try testing.expect(cmd.progress.progress == 100); } +test "OSC: OSC9 conemu wait input" { + const testing = std.testing; + + var p: Parser = .{}; + + const input = "9;5"; + for (input) |ch| p.next(ch); + + const cmd = p.end('\x1b').?; + try testing.expect(cmd == .wait_input); +} + +test "OSC: OSC9 conemu wait ignores trailing characters" { + const testing = std.testing; + + var p: Parser = .{}; + + const input = "9;5;foo"; + for (input) |ch| p.next(ch); + + const cmd = p.end('\x1b').?; + try testing.expect(cmd == .wait_input); +} + test "OSC: empty param" { const testing = std.testing; diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index f75d86c0a..5657d63f4 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -1605,7 +1605,7 @@ pub fn Stream(comptime Handler: type) type { } else log.warn("unimplemented OSC callback: {}", .{cmd}); }, - .progress, .sleep, .show_message_box, .change_conemu_tab_title => { + .progress, .sleep, .show_message_box, .change_conemu_tab_title, .wait_input => { log.warn("unimplemented OSC callback: {}", .{cmd}); }, }