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 ansi::Handler for Term { }, 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),