diff --git a/CHANGELOG.md b/CHANGELOG.md index 2de1929f..b18e470a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,9 @@ * VS15 being ignored ([#1742][1742]). * VS16 being ignored for a subset of the valid VS16 sequences ([#1742][1742]). +* Crash in debug builds, when using OSC-12 to set the cursor color and + foot config has not set any custom cursor colors (i.e. without + OSC-12, inverted fg/bg would be used). [1694]: https://codeberg.org/dnkl/foot/issues/1694 [1717]: https://codeberg.org/dnkl/foot/issues/1717 diff --git a/render.c b/render.c index 35b7c6ae..1853eb48 100644 --- a/render.c +++ b/render.c @@ -556,13 +556,14 @@ cursor_colors_for_cell(const struct terminal *term, const struct cell *cell, const pixman_color_t *fg, const pixman_color_t *bg, pixman_color_t *cursor_color, pixman_color_t *text_color) { - if (term->cursor_color.cursor >> 31) { - xassert(term->cursor_color.text >> 31); - + if (term->cursor_color.cursor >> 31) *cursor_color = color_hex_to_pixman(term->cursor_color.cursor); - *text_color = color_hex_to_pixman(term->cursor_color.text); - } else { + else *cursor_color = *fg; + + if (term->cursor_color.text >> 31) + *text_color = color_hex_to_pixman(term->cursor_color.text); + else { *text_color = *bg; if (unlikely(text_color->alpha != 0xffff)) {