mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-24 12:46:10 +03:00
hook up scroll down and up CSI codes (SD/SU)
This commit is contained in:
@ -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,
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user