implement VT

This commit is contained in:
Mitchell Hashimoto
2022-06-24 18:00:42 -07:00
parent 4661b73d01
commit 4d2d4322f4
3 changed files with 8 additions and 1 deletions

View File

@ -642,7 +642,6 @@ pub fn setCursorRow(self: *Window, row: u16) !void {
} }
pub fn setCursorPos(self: *Window, row: u16, col: u16) !void { pub fn setCursorPos(self: *Window, row: u16, col: u16) !void {
if (self.terminal.mode_origin) unreachable; // TODO
self.terminal.setCursorPos(row, col); self.terminal.setCursorPos(row, col);
} }

View File

@ -13,6 +13,8 @@ pub const C0 = enum(u7) {
HT = 0x09, HT = 0x09,
/// Line feed /// Line feed
LF = 0x0A, LF = 0x0A,
/// Vertical Tab
VT = 0x0B,
/// Carriage return /// Carriage return
CR = 0x0D, CR = 0x0D,
}; };

View File

@ -90,6 +90,12 @@ pub fn Stream(comptime Handler: type) type {
else else
log.warn("unimplemented execute: {x}", .{c}), log.warn("unimplemented execute: {x}", .{c}),
// VT is same as LF
.VT => if (@hasDecl(T, "linefeed"))
try self.handler.linefeed()
else
log.warn("unimplemented execute: {x}", .{c}),
.CR => if (@hasDecl(T, "carriageReturn")) .CR => if (@hasDecl(T, "carriageReturn"))
try self.handler.carriageReturn() try self.handler.carriageReturn()
else else