aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-03 20:32:05 +0200
committeruser <user@clank>2026-09-03 20:32:05 +0200
commitfd80818889fc58b555748180b228980318e6bc10 (patch)
tree36fe01c98f50d7ae9c65a911b76e63e90635a2aa /src/screen.c
parentweb: on one column the hero hovers, not a copy of the logo (diff)
downloadslosh-fd80818889fc58b555748180b228980318e6bc10.tar.gz
slosh-fd80818889fc58b555748180b228980318e6bc10.tar.xz
slosh-fd80818889fc58b555748180b228980318e6bc10.zip
screen: commit a wide cell's tail to prev, or the diff leaves a hole
A wide glyph's tail column is never painted or compared, and prev never learned it either. Overwrite the head later and the terminal blanks the tail cell -- but if that column's new content matches the stale prev, the diff skips it, leaving a one-cell hole where the glyph's second half was. Seen as a missing rule cell in a pane's top border after spawning a new tab: the old tab's centered title started with a wide glyph, the new tab's border put the rule back, and the tail column stayed blank.
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c
index b768162..79a81a9 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -483,6 +483,16 @@ void screen_render(screen_t *s) {
*p = *c;
s->prev_link[idx] = s->cur_link[idx];
+ /* A wide cell owns two columns but only its head is ever compared or
+ * painted, so commit the tail to prev here as well. Leave it stale and
+ * a later frame that puts back what that column used to hold skips it
+ * as unchanged -- while the terminal blanked it the moment the head
+ * was overwritten. The difference is a one-cell hole in a border,
+ * sitting where a wide glyph's second half used to be. */
+ if (c->width == 2 && (size_t)x + 1 < s->cols) {
+ s->prev[idx + 1] = s->cur[idx + 1];
+ s->prev_link[idx + 1] = s->cur_link[idx + 1];
+ }
cx += c->width ? c->width : 1;
if (cx >= s->cols) have_pos = false; /* wrap is terminal-dependent */
}