hook up scroll down and up CSI codes (SD/SU)

This commit is contained in:
Mitchell Hashimoto
2022-08-27 10:46:11 -07:00
parent cd74902f89
commit 1609c8e775
2 changed files with 32 additions and 0 deletions

View File

@ -1627,6 +1627,14 @@ pub fn enquiry(self: *Window) !void {
try self.queueWrite("");
}
pub fn scrollDown(self: *Window, count: usize) !void {
self.terminal.scrollDown(count);
}
pub fn scrollUp(self: *Window, count: usize) !void {
self.terminal.scrollUp(count);
}
pub fn setActiveStatusDisplay(
self: *Window,
req: terminal.StatusDisplay,

View File

@ -275,6 +275,30 @@ 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;
},
},
) else log.warn("unimplemented CSI callback: {}", .{action}),
// Scroll Down (SD)
'T' => if (@hasDecl(T, "scrollDown")) try self.handler.scrollDown(
switch (action.params.len) {
0 => 1,
1 => action.params[0],
else => {
log.warn("invalid scroll down command: {}", .{action});
return;
},
},
) else log.warn("unimplemented CSI callback: {}", .{action}),
// Erase Characters (ECH)
'X' => if (@hasDecl(T, "eraseChars")) try self.handler.eraseChars(
switch (action.params.len) {