NEL next line

This commit is contained in:
Mitchell Hashimoto
2022-06-24 17:55:38 -07:00
parent 51b2786a3b
commit 4661b73d01
3 changed files with 18 additions and 0 deletions

View File

@ -678,6 +678,11 @@ pub fn index(self: *Window) !void {
self.terminal.index();
}
pub fn nextLine(self: *Window) !void {
self.terminal.carriageReturn();
self.terminal.index();
}
pub fn setTopAndBottomMargin(self: *Window, top: u16, bot: u16) !void {
self.terminal.setScrollingRegion(top, bot);
}

View File

@ -492,6 +492,10 @@ pub fn carriageReturn(self: *Terminal) void {
const tracy = trace(@src());
defer tracy.end();
// TODO: left/right margin mode
// TODO: origin mode
// TODO: wrap state
self.cursor.x = 0;
}

View File

@ -384,6 +384,15 @@ pub fn Stream(comptime Handler: type) type {
},
} else log.warn("unimplemented ESC callback: {}", .{action}),
// NEL - Next Line
'E' => if (@hasDecl(T, "nextLine")) switch (action.intermediates.len) {
0 => try self.handler.nextLine(),
else => {
log.warn("invalid next line command: {}", .{action});
return;
},
} else log.warn("unimplemented ESC callback: {}", .{action}),
// RI - Reverse Index
'M' => if (@hasDecl(T, "reverseIndex")) switch (action.intermediates.len) {
0 => try self.handler.reverseIndex(),