aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-08 10:36:57 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-08 10:36:57 -0500
commitba204401e86d27102cb130b305f402a7809b523c (patch)
tree4620ee2c0d5709ab6f1e4374f59e5561a3ae3878
parent25831eb0dbe5a9e222f3e31669f6c0c921d7e911 (diff)
downloadvt100-rust-ba204401e86d27102cb130b305f402a7809b523c.tar.gz
vt100-rust-ba204401e86d27102cb130b305f402a7809b523c.zip
contents_formatted should also reset attributes
for the same reason as contents_diff
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/grid.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 25f5b56..f958810 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,8 @@
* Fixed VPA incorrectly being clamped to the scroll region.
* Stop treating soft hyphen specially (as far as i can tell, no other terminals
do this, and i'm not sure why i thought it was necessary to begin with).
+* `contents_formatted` now also resets attributes at the start, like
+ `contents_diff` does.
## [0.3.1] - 2019-11-06
diff --git a/src/grid.rs b/src/grid.rs
index 0d075ea..4951d25 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -137,7 +137,7 @@ impl Grid {
}
pub fn contents_formatted(&self) -> Vec<u8> {
- let mut contents = b"\x1b[H\x1b[J".to_vec();
+ let mut contents = b"\x1b[m\x1b[H\x1b[J".to_vec();
let mut prev_attrs = crate::attrs::Attrs::default();
let mut final_col = 0;
for row in self.rows() {