diff options
| author | Ayose <ayosec@gmail.com> | 2021-09-24 03:35:07 +0100 |
|---|---|---|
| committer | Ayose <ayosec@gmail.com> | 2021-09-24 03:40:46 +0100 |
| commit | ebf41d5fb035232bc504c568f4e1329a10292848 (patch) | |
| tree | 7bcfd425d5953435cae0e7e0c4e7e622b71245d0 | |
| parent | 18653cf806e746727f41dd7c33d13c51ecd9439e (diff) | |
| download | r-alacritty-ebf41d5fb035232bc504c568f4e1329a10292848.tar.gz r-alacritty-ebf41d5fb035232bc504c568f4e1329a10292848.tar.bz2 r-alacritty-ebf41d5fb035232bc504c568f4e1329a10292848.zip | |
Interprets mode 80 as Sixel Display Mode.
This is reverse of the *sixel scrolling* option, which should match the actual
behaviour of DEC terminals.
For reference: https://github.com/alacritty/alacritty/pull/4763#issuecomment-925374707
| -rw-r--r-- | alacritty_terminal/src/ansi.rs | 4 | ||||
| -rw-r--r-- | alacritty_terminal/src/term/mod.rs | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 35763f92..3fc3f2ba 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -546,7 +546,7 @@ pub enum Mode { /// ?25 ShowCursor = 25, /// ?80 - SixelScrolling = 80, + SixelDisplay = 80, /// ?1000 ReportMouseClicks = 1000, /// ?1002 @@ -590,7 +590,7 @@ impl Mode { 7 => Mode::LineWrap, 12 => Mode::BlinkingCursor, 25 => Mode::ShowCursor, - 80 => Mode::SixelScrolling, + 80 => Mode::SixelDisplay, 1000 => Mode::ReportMouseClicks, 1002 => Mode::ReportCellMouseMotion, 1003 => Mode::ReportAllMouseMotion, diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 451663f7..ccf5ce58 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -67,7 +67,7 @@ bitflags! { const ALTERNATE_SCROLL = 0b0000_1000_0000_0000_0000; const VI = 0b0001_0000_0000_0000_0000; const URGENCY_HINTS = 0b0010_0000_0000_0000_0000; - const SIXEL_SCROLLING = 0b0100_0000_0000_0000_0000; + const SIXEL_DISPLAY = 0b0100_0000_0000_0000_0000; const SIXEL_PRIV_PALETTE = 0b1000_0000_0000_0000_0000; const SIXEL_CURSOR_TO_THE_RIGHT = 0b0001_0000_0000_0000_0000_0000; const ANY = std::u32::MAX; @@ -80,7 +80,6 @@ impl Default for TermMode { | TermMode::LINE_WRAP | TermMode::ALTERNATE_SCROLL | TermMode::URGENCY_HINTS - | TermMode::SIXEL_SCROLLING | TermMode::SIXEL_PRIV_PALETTE } } @@ -1598,7 +1597,7 @@ impl<T: EventListener> Handler for Term<T> { style.blinking = true; self.event_proxy.send_event(Event::CursorBlinkingChange(true)); }, - ansi::Mode::SixelScrolling => self.mode.insert(TermMode::SIXEL_SCROLLING), + ansi::Mode::SixelDisplay => self.mode.insert(TermMode::SIXEL_DISPLAY), ansi::Mode::SixelPrivateColorRegisters => { self.mode.insert(TermMode::SIXEL_PRIV_PALETTE) }, @@ -1647,7 +1646,7 @@ impl<T: EventListener> Handler for Term<T> { style.blinking = false; self.event_proxy.send_event(Event::CursorBlinkingChange(false)); }, - ansi::Mode::SixelScrolling => self.mode.remove(TermMode::SIXEL_SCROLLING), + ansi::Mode::SixelDisplay => self.mode.remove(TermMode::SIXEL_DISPLAY), ansi::Mode::SixelPrivateColorRegisters => { self.graphics.sixel_shared_palette = None; self.mode.remove(TermMode::SIXEL_PRIV_PALETTE); @@ -1838,7 +1837,7 @@ impl<T: EventListener> Handler for Term<T> { let graphic_id = self.graphics.next_id(); self.graphics.pending.push(GraphicData { id: graphic_id, ..graphic }); - // If SIXEL_SCROLLING is enabled, the start of the graphic is the + // If SIXEL_DISPLAY is disabled, the start of the graphic is the // cursor position, and the grid can be scrolled if the graphic is // larger than the screen. The cursor is moved to the next line // after the graphic. @@ -1846,7 +1845,7 @@ impl<T: EventListener> Handler for Term<T> { // If it is disabled, the graphic starts at (0, 0), the grid is never // scrolled, and the cursor position is unmodified. - let scrolling = self.mode.contains(TermMode::SIXEL_SCROLLING); + let scrolling = !self.mode.contains(TermMode::SIXEL_DISPLAY); // Fill the cells under the graphic. // |