terminal: term_fill(): fix osc8 erase bug + handle styled underlines

Only clear OSC-8 hyperlinks at the target columns if we don't have an
active OSC-8 URI. This corresponds to normal VT attributes; the
currently active attributes are set, and all others are cleared.

Handle styled underlines in the same way
This commit is contained in:
Daniel Eklöf 2024-06-24 01:07:17 +02:00
parent 963ce45f3f
commit 3b738c6e68
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -3636,11 +3636,25 @@ term_fill(struct terminal *term, int r, int c, uint8_t data, size_t count,
break;
}
}
if (unlikely(term->vt.curly.style > CURLY_SINGLE ||
term->vt.curly.color_src != COLOR_DEFAULT))
{
grid_row_curly_range_put(row, c, term->vt.curly);
}
}
if (unlikely(row->extra != NULL)) {
grid_row_uri_range_erase(row, c, c + count - 1);
grid_row_curly_range_erase(row, c, c + count - 1);
if (likely(term->vt.osc8.uri != NULL))
grid_row_uri_range_erase(row, c, c + count - 1);
if (likely(term->vt.curly.style <= CURLY_SINGLE &&
term->vt.curly.color_src == COLOR_DEFAULT))
{
/* No extended/styled underlines active, so erase any such
attributes at the target columns */
grid_row_curly_range_erase(row, c, c + count - 1);
}
}
}