From 8694d29bd09517205ed849977399ba87da2b6e13 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 17 Sep 2023 09:39:03 -0700 Subject: [PATCH] terminal: ignore CSI S with intermediates --- src/terminal/stream.zig | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index 824d08ffa..3789d5611 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -300,16 +300,24 @@ pub fn Stream(comptime Handler: type) type { ) else log.warn("unimplemented CSI callback: {}", .{action}), // Scroll Up (SD) - 'S' => if (@hasDecl(T, "scrollUp")) try self.handler.scrollUp( - switch (action.params.len) { - 0 => 1, - 1 => action.params[0], - else => { - log.warn("invalid scroll up command: {}", .{action}); - return; + + 'S' => switch (action.intermediates.len) { + 0 => if (@hasDecl(T, "scrollUp")) try self.handler.scrollUp( + switch (action.params.len) { + 0 => 1, + 1 => action.params[0], + else => { + log.warn("invalid scroll up command: {}", .{action}); + return; + }, }, - }, - ) else log.warn("unimplemented CSI callback: {}", .{action}), + ) else log.warn("unimplemented CSI callback: {}", .{action}), + + else => log.warn( + "ignoring unimplemented CSI S with intermediates: {s}", + .{action.intermediates}, + ), + }, // Scroll Down (SD) 'T' => if (@hasDecl(T, "scrollDown")) try self.handler.scrollDown(