diff options
| author | Aiden Gall <aiden@aidengall.xyz> | 2024-03-03 21:52:34 +0000 |
|---|---|---|
| committer | Aiden Gall <aiden@aidengall.xyz> | 2024-03-03 21:52:34 +0000 |
| commit | 1170778edb6647215319c93ca3588cd3400cea3b (patch) | |
| tree | 21df0454de4e25842129306f97973eefd35c4b71 /st.c | |
| parent | 3271a61f33957f5926579a9b158fbd2de8838bce (diff) | |
merge upstream
Diffstat (limited to 'st.c')
| -rw-r--r-- | st.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -110,8 +110,8 @@ enum escape_state { typedef struct { Glyph attr; /* current char attributes */ - int x; - int y; + int x; /* terminal column */ + int y; /* terminal row */ char state; } TCursor; @@ -1960,6 +1960,7 @@ csihandle(void) } break; case 'S': /* SU -- Scroll <n> line up */ + if (csiescseq.priv) break; DEFAULT(csiescseq.arg[0], 1); /* xterm, urxvt, alacritty save this in history */ tscrollup(term.top, term.bot, csiescseq.arg[0], SCROLL_SAVEHIST); @@ -2401,12 +2402,16 @@ tstrsequence(uchar c) void tcontrolcode(uchar ascii) { + size_t i; + switch (ascii) { case '\t': /* HT */ tputtab(1); return; case '\b': /* BS */ - tmoveto(term.c.x-1, term.c.y); + for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i) + ; + tmoveto(term.c.x - i, term.c.y); return; case '\r': /* CR */ tmoveto(0, term.c.y); |
