summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <wchibisovkirill@gmail.com>2019-11-12 19:50:33 +0300
committerChristian Duerr <contact@christianduerr.com>2019-11-12 17:50:33 +0100
commitd707e064a97532b36c68088ba44cd8a10f6f71dc (patch)
treee47648311a8ad09262afed8315565698dc044cc6
parentcce3af3d916aeced80002146d4d8ec8507b1a081 (diff)
downloadalacritty-d707e064a97532b36c68088ba44cd8a10f6f71dc.tar.gz
alacritty-d707e064a97532b36c68088ba44cd8a10f6f71dc.zip
Fix mouse modes not being mutually exclusive
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty_terminal/src/term/mod.rs15
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f7a2c956..006000b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -79,6 +79,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Underline/strikeout drawn above visual bell
- Terminal going transparent during visual bell
- Selection not being cleared when sending chars through a binding
+- Mouse protocols/encodings not being mutually exclusive within themselves
### Removed
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index 1622ecec..858402a4 100644
--- a/alacritty_terminal/src/term/mod.rs
+++ b/alacritty_terminal/src/term/mod.rs
@@ -1878,22 +1878,33 @@ impl<T: EventListener> ansi::Handler for Term<T> {
},
ansi::Mode::ShowCursor => self.mode.insert(TermMode::SHOW_CURSOR),
ansi::Mode::CursorKeys => self.mode.insert(TermMode::APP_CURSOR),
+ // Mouse protocols are mutually exlusive
ansi::Mode::ReportMouseClicks => {
+ self.mode.remove(TermMode::MOUSE_MODE);
self.mode.insert(TermMode::MOUSE_REPORT_CLICK);
self.event_proxy.send_event(Event::MouseCursorDirty);
},
ansi::Mode::ReportCellMouseMotion => {
+ self.mode.remove(TermMode::MOUSE_MODE);
self.mode.insert(TermMode::MOUSE_DRAG);
self.event_proxy.send_event(Event::MouseCursorDirty);
},
ansi::Mode::ReportAllMouseMotion => {
+ self.mode.remove(TermMode::MOUSE_MODE);
self.mode.insert(TermMode::MOUSE_MOTION);
self.event_proxy.send_event(Event::MouseCursorDirty);
},
ansi::Mode::ReportFocusInOut => self.mode.insert(TermMode::FOCUS_IN_OUT),
ansi::Mode::BracketedPaste => self.mode.insert(TermMode::BRACKETED_PASTE),
- ansi::Mode::SgrMouse => self.mode.insert(TermMode::SGR_MOUSE),
- ansi::Mode::Utf8Mouse => self.mode.insert(TermMode::UTF8_MOUSE),
+ // Mouse encodings are mutually exlusive
+ ansi::Mode::SgrMouse => {
+ self.mode.remove(TermMode::UTF8_MOUSE);
+ self.mode.insert(TermMode::SGR_MOUSE);
+ },
+ ansi::Mode::Utf8Mouse => {
+ self.mode.remove(TermMode::SGR_MOUSE);
+ self.mode.insert(TermMode::UTF8_MOUSE);
+ },
ansi::Mode::AlternateScroll => self.mode.insert(TermMode::ALTERNATE_SCROLL),
ansi::Mode::LineWrap => self.mode.insert(TermMode::LINE_WRAP),
ansi::Mode::LineFeedNewLine => self.mode.insert(TermMode::LINE_FEED_NEW_LINE),