fixed weird characters

backspacing is now not broken!
This commit is contained in:
cowmonk 2025-01-21 13:56:25 -07:00
parent 7e11c02405
commit a044864f92

View File

@ -1070,6 +1070,10 @@ static int master_cb(int fd, void *data, Window window) {
case '\b': case '\b':
if (cursor_x > 0) { if (cursor_x > 0) {
cursor_x--; cursor_x--;
terminal_buffer[cursor_y][cursor_x] = ' ';
color_buffer[cursor_y][cursor_x] = current_color;
attr_buffer[cursor_y][cursor_x] = current_attr;
bg_color_buffer[cursor_y][cursor_x] = current_bg_color;
needs_refresh = 1; needs_refresh = 1;
} else if (cursor_y > 0) { } else if (cursor_y > 0) {
cursor_y--; cursor_y--;
@ -1082,16 +1086,18 @@ static int master_cb(int fd, void *data, Window window) {
default: default:
if (cursor_y >= term_rows || cursor_x >= term_cols) if (cursor_y >= term_rows || cursor_x >= term_cols)
break; break;
terminal_buffer[cursor_y][cursor_x] = buf[i]; if (buf[i] >= 32 && buf[i] <= 126) {
color_buffer[cursor_y][cursor_x] = current_color; terminal_buffer[cursor_y][cursor_x] = buf[i];
attr_buffer[cursor_y][cursor_x] = current_attr; color_buffer[cursor_y][cursor_x] = current_color;
bg_color_buffer[cursor_y][cursor_x] = current_bg_color; attr_buffer[cursor_y][cursor_x] = current_attr;
needs_refresh = 1; bg_color_buffer[cursor_y][cursor_x] = current_bg_color;
if (++cursor_x >= term_cols) { needs_refresh = 1;
cursor_x = 0; if (++cursor_x >= term_cols) {
if (++cursor_y >= term_rows) { cursor_x = 0;
scroll_region_up(1); if (++cursor_y >= term_rows) {
cursor_y = term_rows - 1; scroll_region_up(1);
cursor_y = term_rows - 1;
}
} }
} }
break; break;