aboutsummaryrefslogtreecommitdiff
path: root/src/ansi.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-06-23 09:42:00 -0700
committerJoe Wilm <joe@jwilm.com>2016-06-23 09:43:55 -0700
commit09600a3d402a08c94803c00624fa7ac7bcfad73e (patch)
tree5eb6bede5318f300fc40aadf9b215b80c1c4894f /src/ansi.rs
parentf5faa40066e87d615e35dd3d62b96ccc9a49e705 (diff)
downloadalacritty-09600a3d402a08c94803c00624fa7ac7bcfad73e.tar.gz
alacritty-09600a3d402a08c94803c00624fa7ac7bcfad73e.zip
Fix bug handling ansi mode sequences
The sense of set_mode and unset_mode was inverted. The TextCursor/ShowCursor mode depended on the incorrect behavior, and that was fixed as well. TextCursor was renamed to ShowCursor to be perfectly clear on the intent.
Diffstat (limited to 'src/ansi.rs')
-rw-r--r--src/ansi.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ansi.rs b/src/ansi.rs
index c55b8376..c0e9ec34 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -53,7 +53,7 @@ pub enum Mode {
/// ?1
CursorKeys = 1,
/// ?25
- TextCursor = 25,
+ ShowCursor = 25,
/// ?12
BlinkingCursor = 12,
/// ?1049
@@ -69,7 +69,7 @@ impl Mode {
Some(match num {
1 => Mode::CursorKeys,
12 => Mode::BlinkingCursor,
- 25 => Mode::TextCursor,
+ 25 => Mode::ShowCursor,
1049 => Mode::SwapScreenAndSetRestoreCursor,
_ => return None
})
@@ -627,7 +627,7 @@ impl Parser {
'l' => {
let mode = Mode::from_primitive(private, args[0]);
match mode {
- Some(mode) => handler.set_mode(mode),
+ Some(mode) => handler.unset_mode(mode),
None => unhandled!(),
}
},
@@ -639,7 +639,7 @@ impl Parser {
'h' => {
let mode = Mode::from_primitive(private, args[0]);
match mode {
- Some(mode) => handler.unset_mode(mode),
+ Some(mode) => handler.set_mode(mode),
None => unhandled!(),
}
},