diff options
author | Aaron Hill <aa1ronham@gmail.com> | 2017-05-29 12:51:49 -0400 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-05-29 09:51:49 -0700 |
commit | 0321f3dcfb576763625a74392332e627ad5ece1b (patch) | |
tree | 1452c8d90e838173fea99a764665d0f494b36b40 /src/term | |
parent | 81116fb8a4f91f28b5751827e7bcda22f6fcbaf0 (diff) | |
download | alacritty-0321f3dcfb576763625a74392332e627ad5ece1b.tar.gz alacritty-0321f3dcfb576763625a74392332e627ad5ece1b.zip |
Implement FocusIn/FocusOut reports (#589)
Implements sending FocusIn/FocusOut events, as defined at
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-FocusIn_FocusOut
Diffstat (limited to 'src/term')
-rw-r--r-- | src/term/mod.rs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index f600347b..1316ac20 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -252,18 +252,19 @@ impl<'a> Iterator for RenderableCellsIter<'a> { pub mod mode { bitflags! { pub flags TermMode: u16 { - const SHOW_CURSOR = 0b00000000001, - const APP_CURSOR = 0b00000000010, - const APP_KEYPAD = 0b00000000100, - const MOUSE_REPORT_CLICK = 0b00000001000, - const BRACKETED_PASTE = 0b00000010000, - const SGR_MOUSE = 0b00000100000, - const MOUSE_MOTION = 0b00001000000, - const LINE_WRAP = 0b00010000000, - const LINE_FEED_NEW_LINE = 0b00100000000, - const ORIGIN = 0b01000000000, - const INSERT = 0b10000000000, - const ANY = 0b11111111111, + const SHOW_CURSOR = 0b000000000001, + const APP_CURSOR = 0b000000000010, + const APP_KEYPAD = 0b000000000100, + const MOUSE_REPORT_CLICK = 0b000000001000, + const BRACKETED_PASTE = 0b000000010000, + const SGR_MOUSE = 0b000000100000, + const MOUSE_MOTION = 0b000001000000, + const LINE_WRAP = 0b000010000000, + const LINE_FEED_NEW_LINE = 0b000100000000, + const ORIGIN = 0b001000000000, + const INSERT = 0b010000000000, + const FOCUS_IN_OUT = 0b100000000000, + const ANY = 0b111111111111, const NONE = 0, } } @@ -1631,6 +1632,7 @@ impl ansi::Handler for Term { ansi::Mode::CursorKeys => self.mode.insert(mode::APP_CURSOR), ansi::Mode::ReportMouseClicks => self.mode.insert(mode::MOUSE_REPORT_CLICK), ansi::Mode::ReportMouseMotion => self.mode.insert(mode::MOUSE_MOTION), + ansi::Mode::ReportFocusInOut => self.mode.insert(mode::FOCUS_IN_OUT), ansi::Mode::BracketedPaste => self.mode.insert(mode::BRACKETED_PASTE), ansi::Mode::SgrMouse => self.mode.insert(mode::SGR_MOUSE), ansi::Mode::LineWrap => self.mode.insert(mode::LINE_WRAP), @@ -1657,6 +1659,7 @@ impl ansi::Handler for Term { ansi::Mode::CursorKeys => self.mode.remove(mode::APP_CURSOR), ansi::Mode::ReportMouseClicks => self.mode.remove(mode::MOUSE_REPORT_CLICK), ansi::Mode::ReportMouseMotion => self.mode.remove(mode::MOUSE_MOTION), + ansi::Mode::ReportFocusInOut => self.mode.remove(mode::FOCUS_IN_OUT), ansi::Mode::BracketedPaste => self.mode.remove(mode::BRACKETED_PASTE), ansi::Mode::SgrMouse => self.mode.remove(mode::SGR_MOUSE), ansi::Mode::LineWrap => self.mode.remove(mode::LINE_WRAP), |