aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-06-23 23:07:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-06-26 16:39:24 +0000
commit3b738c6e683702f25ad8101a686db5917de8e0e4 (patch)
tree0ac3ce12569db91911ebddaec64b9e03e46c2b6a
parentrender: resize: copy styled underlines to temporary grid (diff)
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
-rw-r--r--terminal.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/terminal.c b/terminal.c
index 48c0b298..771e4878 100644
--- a/terminal.c
+++ b/terminal.c
@@ -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);
+ }
}
}