Browse Source

Fix resets

Björn Åström 1 year ago
parent
commit
425790c066
1 changed files with 13 additions and 4 deletions
  1. 13 4
      term.c

+ 13 - 4
term.c

@@ -135,6 +135,13 @@ static void term_execute(struct term *t, char c) {
 		case '\r': t->cursor.x = 0; break;
 
 		case '\b': term_cursor_move_left(t, 1); break;
+
+		case '\t':
+			term_print(t, ' ');
+			term_print(t, ' ');
+			term_print(t, ' ');
+			term_print(t, ' ');
+			break;
 	}
 }
 
@@ -179,8 +186,9 @@ static void term_csi_erase_in_display(struct term *t) {
 
 	for (int i = start_y; i < end_y; i++) {
 		for (int j = start_x; j < end_x; j++) {
-			// TODO: clear sgr
-			t->rows[i].cells[j].c = ' ';
+			struct cell *cur_cell = &t->rows[i].cells[j];
+			cur_cell->c = ' ';
+			cur_cell->sgra.normal = 1;
 		}
 	}
 }
@@ -207,8 +215,9 @@ static void term_csi_erase_in_line(struct term *t) {
 	}
 
 	for (int j = start_x; j < end_x; j++) {
-		// TODO: clear sgr
-		t->rows[t->cursor.y].cells[j].c = ' ';
+		struct cell *cur_cell = &t->rows[t->cursor.y].cells[j];
+		cur_cell->c = ' ';
+		cur_cell->sgra.normal = 1;
 	}
 }