aboutsummaryrefslogtreecommitdiff
path: root/src/term
diff options
context:
space:
mode:
Diffstat (limited to 'src/term')
-rw-r--r--src/term/mod.rs39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 88e4b63c..5ba192ff 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -418,20 +418,21 @@ impl<'a> Iterator for RenderableCellsIter<'a> {
pub mod mode {
bitflags! {
pub struct TermMode: u16 {
- const SHOW_CURSOR = 0b0_0000_0000_0001;
- const APP_CURSOR = 0b0_0000_0000_0010;
- const APP_KEYPAD = 0b0_0000_0000_0100;
- const MOUSE_REPORT_CLICK = 0b0_0000_0000_1000;
- const BRACKETED_PASTE = 0b0_0000_0001_0000;
- const SGR_MOUSE = 0b0_0000_0010_0000;
- const MOUSE_MOTION = 0b0_0000_0100_0000;
- const LINE_WRAP = 0b0_0000_1000_0000;
- const LINE_FEED_NEW_LINE = 0b0_0001_0000_0000;
- const ORIGIN = 0b0_0010_0000_0000;
- const INSERT = 0b0_0100_0000_0000;
- const FOCUS_IN_OUT = 0b0_1000_0000_0000;
- const ALT_SCREEN = 0b1_0000_0000_0000;
- const ANY = 0b1_1111_1111_1111;
+ const SHOW_CURSOR = 0b00_0000_0000_0001;
+ const APP_CURSOR = 0b00_0000_0000_0010;
+ const APP_KEYPAD = 0b00_0000_0000_0100;
+ const MOUSE_REPORT_CLICK = 0b00_0000_0000_1000;
+ const BRACKETED_PASTE = 0b00_0000_0001_0000;
+ const SGR_MOUSE = 0b00_0000_0010_0000;
+ const MOUSE_MOTION = 0b00_0000_0100_0000;
+ const LINE_WRAP = 0b00_0000_1000_0000;
+ const LINE_FEED_NEW_LINE = 0b00_0001_0000_0000;
+ const ORIGIN = 0b00_0010_0000_0000;
+ const INSERT = 0b00_0100_0000_0000;
+ const FOCUS_IN_OUT = 0b00_1000_0000_0000;
+ const ALT_SCREEN = 0b01_0000_0000_0000;
+ const MOUSE_DRAG = 0b10_0000_0000_0000;
+ const ANY = 0b11_1111_1111_1111;
const NONE = 0;
}
}
@@ -1832,7 +1833,10 @@ impl ansi::Handler for Term {
self.mode.insert(mode::TermMode::MOUSE_REPORT_CLICK);
self.set_mouse_cursor(MouseCursor::Arrow);
},
- ansi::Mode::ReportCellMouseMotion |
+ ansi::Mode::ReportCellMouseMotion => {
+ self.mode.insert(mode::TermMode::MOUSE_DRAG);
+ self.set_mouse_cursor(MouseCursor::Arrow);
+ },
ansi::Mode::ReportAllMouseMotion => {
self.mode.insert(mode::TermMode::MOUSE_MOTION);
self.set_mouse_cursor(MouseCursor::Arrow);
@@ -1869,7 +1873,10 @@ impl ansi::Handler for Term {
self.mode.remove(mode::TermMode::MOUSE_REPORT_CLICK);
self.set_mouse_cursor(MouseCursor::Text);
},
- ansi::Mode::ReportCellMouseMotion |
+ ansi::Mode::ReportCellMouseMotion => {
+ self.mode.remove(mode::TermMode::MOUSE_DRAG);
+ self.set_mouse_cursor(MouseCursor::Text);
+ },
ansi::Mode::ReportAllMouseMotion => {
self.mode.remove(mode::TermMode::MOUSE_MOTION);
self.set_mouse_cursor(MouseCursor::Text);