don't crash on htab, but its not implemented yet

This commit is contained in:
Mitchell Hashimoto
2022-04-27 09:30:39 -07:00
parent 2767f19ced
commit 3857e7f519
2 changed files with 8 additions and 0 deletions

View File

@ -133,6 +133,7 @@ fn execute(self: *Terminal, c: u8) !void {
switch (@intToEnum(ansi.C0, c)) {
.BEL => self.bell(),
.BS => self.backspace(),
.HT => self.horizontal_tab(),
.LF => self.linefeed(),
.CR => self.carriage_return(),
}
@ -149,6 +150,11 @@ pub fn backspace(self: *Terminal) void {
self.cursor.x -|= 1;
}
/// TODO
pub fn horizontal_tab(self: *Terminal) void {
_ = self;
}
/// Carriage return moves the cursor to the first column.
pub fn carriage_return(self: *Terminal) void {
self.cursor.x = 0;

View File

@ -7,6 +7,8 @@ pub const C0 = enum(u7) {
BEL = 0x07,
/// Backspace
BS = 0x08,
// Horizontal tab
HT = 0x09,
/// Line feed
LF = 0x0A,
/// Carriage return