aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2026-08-17 17:49:22 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-08-17 17:49:22 +0000
commit766e227e4fc343d8f2b9b7ee228b2cc7cfc60ee7 (patch)
treeb06fefea95e4cfc7bc05192b40c48bbf6bb9403b
parentterminal: keep saved SGR attributes per-grid (diff)
term: don't do a cursor refresh if we're shutting down
When running e.g. "foot true", we may reach a state where the window has received the configure event, but we've also already decided to shutdown. In this case, we may not have a grid (render_resize() doesn't do anything when we've started the shutdown routine). Fixes a race that triggers a crash.
-rw-r--r--terminal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/terminal.c b/terminal.c
index 868861d2..e6d913e3 100644
--- a/terminal.c
+++ b/terminal.c
@@ -523,7 +523,7 @@ term_arm_blink_timer(struct terminal *term)
static void
cursor_refresh(struct terminal *term)
{
- if (!term->window->is_configured)
+ if (unlikely(!term->window->is_configured || term->shutdown.in_progress))
return;
term->grid->cur_row->cells[term->grid->cursor.point.col].attrs.clean = 0;