summaryrefslogtreecommitdiff
path: root/src/term
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-04-19 09:03:33 -0700
committerJoe Wilm <joe@jwilm.com>2017-04-19 09:03:33 -0700
commit77295e7f9e04660598b0323924c142cde30429f4 (patch)
treeb91b097c33d79fa790b0baa9423b863fb880d67e /src/term
parent197e910d63bea2a334d402a342b58e37f93b4b85 (diff)
downloadalacritty-77295e7f9e04660598b0323924c142cde30429f4.tar.gz
alacritty-77295e7f9e04660598b0323924c142cde30429f4.zip
Partially add DECCOLM support
It's not possible with DECCOLM to temporarily set 80 or 132 column mode since the function is a toggle between the two. Instead, only the additional affects are run in order to get closer to passing vttest. vttest will never be perfect due to the column mode issue.
Diffstat (limited to 'src/term')
-rw-r--r--src/term/mod.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 9993d2b3..40fb58e1 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -1014,6 +1014,17 @@ impl Term {
self.grid.scroll_up(origin..end, lines);
}
}
+
+ fn deccolm(&mut self) {
+ // Setting 132 column font makes no sense, but run the other side effects
+ // Clear scrolling region
+ let scroll_region = Line(0)..self.grid.num_lines();
+ self.set_scrolling_region(scroll_region);
+
+ // Clear grid
+ let template = self.empty_cell;
+ self.grid.clear(|c| c.reset(&template));
+ }
}
impl ansi::TermInfo for Term {
@@ -1572,6 +1583,7 @@ impl ansi::Handler for Term {
ansi::Mode::LineWrap => self.mode.insert(mode::LINE_WRAP),
ansi::Mode::LineFeedNewLine => self.mode.insert(mode::LINE_FEED_NEW_LINE),
ansi::Mode::Origin => self.mode.insert(mode::ORIGIN),
+ ansi::Mode::DECCOLM => self.deccolm(),
_ => {
debug!(".. ignoring set_mode");
}
@@ -1596,6 +1608,7 @@ impl ansi::Handler for Term {
ansi::Mode::LineWrap => self.mode.remove(mode::LINE_WRAP),
ansi::Mode::LineFeedNewLine => self.mode.remove(mode::LINE_FEED_NEW_LINE),
ansi::Mode::Origin => self.mode.remove(mode::ORIGIN),
+ ansi::Mode::DECCOLM => self.deccolm(),
_ => {
debug!(".. ignoring unset_mode");
}