commit 44ad005fb1be3e86ab1301896d4cc8a708af69cf
parent c366e8a25619b60cf09e8ae10b4d43c9f0c14ae8
Author: Claudio Alessi <smoppy@gmail.com>
Date: Mon, 5 Jan 2026 14:16:01 +0100
Avoid visual glitch for some emoji at the EOL.
This is happens with emoji like the cloud which belongs to the ambiguous
set. We may apply this fix only to ambi characters maybe... We will see.
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tui.c b/tui.c
@@ -217,11 +217,9 @@ tui_draw_line_compat(UI *ui, int x, int y, Cell *cells, int count) {
if(w > 0) cw = w;
if(was_emoji) {
- const char t[] = "\x1b[48;5;232m";
+ /* ERASECHAR to clear eventual garbage state */
+ const char t[] = "\x1b[48;5;232m"ERASECHAR;
ab_write(&frame, t, sizeof t - 1);
-
- /* clear eventual garbage state */
- ab_write(&frame, ERASECHAR, strlen(ERASECHAR));
}
ab_write(&frame, txt + o, step);
@@ -251,6 +249,13 @@ tui_draw_line_compat(UI *ui, int x, int y, Cell *cells, int count) {
was_emoji = cells[i].len > 1 || IS_RIS(cp);
if(was_emoji) tui_move_cursor(x, y);
}
+
+ /* TODO: this only happens with ambi characters? */
+ if(was_emoji) {
+ const char t[] = "\x1b[48;5;232m \x1b[0m";
+ ab_write(&frame, t, sizeof t - 1);
+ }
+
ab_write(&frame, CLEARRIGHT, strlen(CLEARRIGHT));
}