diff --git a/docs/changelog.md b/docs/changelog.md index 4362d18c5..e44624280 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -16,6 +16,9 @@ As features stabilize some brief notes about them will accumulate here. Thanks to [@unrelentingtech](https://github.com/unrelentingtech)! [#2492](https://github.com/wez/wezterm/pull/2492) [#2452](https://github.com/wez/wezterm/issues/2452) +* If the underline attribute was active and CRLF scrolled a new line into the + bottom of the display, we'd fill that new line with underlines. + [#2489](https://github.com/wez/wezterm/issues/2489) ### 20220905-102802-7d4b8249 diff --git a/termwiz/src/cell.rs b/termwiz/src/cell.rs index b4cb1d7b0..e69da2bd5 100644 --- a/termwiz/src/cell.rs +++ b/termwiz/src/cell.rs @@ -483,6 +483,20 @@ impl CellAttributes { // easier time in get_semantic_zones. res.set_semantic_type(SemanticType::default()); res.set_underline_color(self.underline_color()); + + // Turn off underline because it can have surprising results + // if underline is on, then we get CRLF and then SGR reset: + // If the CRLF causes a line to scroll, we'll call clone_sgr_only() + // to get a blank cell for the new line and it would be filled + // with underlines. + // clone_sgr_only() is primarily for preserving the background + // color when erasing rather than other attributes, so it should + // be fine to clear out the actual underline attribute. + // Let's extend this to other line attribute types as well. + // + res.set_underline(Underline::None); + res.set_overline(false); + res.set_strikethrough(false); res }