From 766e227e4fc343d8f2b9b7ee228b2cc7cfc60ee7 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 17 Aug 2026 19:49:22 +0200 Subject: 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. --- terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.3