aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c59
1 files changed, 19 insertions, 40 deletions
diff --git a/vt.c b/vt.c
index e7336dc6..79e9871e 100644
--- a/vt.c
+++ b/vt.c
@@ -608,43 +608,6 @@ esc_dispatch(struct terminal *term, uint8_t final)
term_reset(term, true);
break;
-#if 0
- case '0': {
- /* Configure G0-G3 to use special chars + line drawing */
- char param = term->vt.private[0] != 0 ? term->vt.private[0] : 0;
-
- switch (param) {
- case '(': term->charset[0] = CHARSET_GRAPHIC; break;
- case ')': term->charset[1] = CHARSET_GRAPHIC; break;
- case '*': term->charset[2] = CHARSET_GRAPHIC; break;
- case '+': term->charset[3] = CHARSET_GRAPHIC; break;
- case 0: break;
-
- default:
- UNHANDLED();
- break;
- }
- break;
- }
-
- case 'B': {
- /* Configure G0-G3 to use ASCII */
- char param = term->vt.private[0] != 0 ? term->vt.private[0] : 0;
-
- switch (param) {
- case '(': term->charset[0] = CHARSET_ASCII; break;
- case ')': term->charset[1] = CHARSET_ASCII; break;
- case '*': term->charset[2] = CHARSET_ASCII; break;
- case '+': term->charset[3] = CHARSET_ASCII; break;
- case 0: break;
-
- default:
- UNHANDLED();
- break;
- }
- break;
- }
-#endif
case 'D':
term_linefeed(term);
break;
@@ -654,6 +617,17 @@ esc_dispatch(struct terminal *term, uint8_t final)
term_cursor_left(term, term->cursor.col);
break;
+ case 'H':
+ tll_foreach(term->tab_stops, it) {
+ if (it->item >= term->cursor.col) {
+ tll_insert_before(term->tab_stops, it, term->cursor.col);
+ break;
+ }
+ }
+
+ tll_push_back(term->tab_stops, term->cursor.col);
+ break;
+
case 'M':
term_reverse_index(term);
break;
@@ -892,9 +866,14 @@ action(struct terminal *term, enum action _action, uint8_t c)
case '\x09': {
/* HT - horizontal tab */
- int col = term->cursor.col;
- col = (col + 8) / 8 * 8;
- term_cursor_right(term, col - term->cursor.col);
+ int new_col = term->cursor.col;
+ tll_foreach(term->tab_stops, it) {
+ if (it->item >= term->cursor.col) {
+ new_col = it->item;
+ break;
+ }
+ }
+ term_cursor_right(term, new_col - term->cursor.col);
break;
}