From c5529808c4f13c5bd30594055563b83e1db61dfd Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 9 Jan 2025 07:49:29 +0100 Subject: term: cursor_refresh(): don't try to dirty the grid if we don't have one If the compositor sends a keyboard enter event before our window has been mapped, foot crashes; the enter event triggers a cursor refresh (hollow -> non-hollow block cursor), which crashes since we haven't yet allocated a grid. Fix by no-op:ing the refresh if the window hasn't been configured yet. Closes #1910 --- terminal.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 7b5a4d2d..e392c36d 100644 --- a/terminal.c +++ b/terminal.c @@ -515,6 +515,9 @@ term_arm_blink_timer(struct terminal *term) static void cursor_refresh(struct terminal *term) { + if (!term->window->is_configured) + return; + term->grid->cur_row->cells[term->grid->cursor.point.col].attrs.clean = 0; term->grid->cur_row->dirty = true; render_refresh(term); -- cgit v1.3