diff options
author | Christian Duerr <contact@christianduerr.com> | 2022-04-01 01:10:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 23:10:12 +0000 |
commit | 49d64fbeecbdde2293ca0e7c7346941791685c3e (patch) | |
tree | b2bf743b9cda53399185cd45b5dc1d1fb3e851eb /alacritty_terminal/src/term | |
parent | b16fe1259cebcd6adb4bc92f7025beb696412b89 (diff) | |
download | alacritty-49d64fbeecbdde2293ca0e7c7346941791685c3e.tar.gz alacritty-49d64fbeecbdde2293ca0e7c7346941791685c3e.zip |
Fix OSC 4 color response format
The commit 60ef17e introduced support for the color query response
escape for OSC 4, however it did omit the `4;` prefix and started the
OSC with just the color index.
This patch fixes this bug and correctly responds to queries with full
OSC 4 format, including prefix plus color index.
Fixes #5981.
Diffstat (limited to 'alacritty_terminal/src/term')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index fa7d2b66..14dd306e 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1630,10 +1630,10 @@ impl<T: EventListener> Handler for Term<T> { self.colors[index] = Some(color); } - /// Write a foreground/background color escape sequence with the current color. + /// Respond to a color query escape sequence. #[inline] - fn dynamic_color_sequence(&mut self, code: u8, index: usize, terminator: &str) { - trace!("Requested write of escape sequence for color code {}: color[{}]", code, index); + fn dynamic_color_sequence(&mut self, prefix: String, index: usize, terminator: &str) { + trace!("Requested write of escape sequence for color code {}: color[{}]", prefix, index); let terminator = terminator.to_owned(); self.event_proxy.send_event(Event::ColorRequest( @@ -1641,7 +1641,7 @@ impl<T: EventListener> Handler for Term<T> { Arc::new(move |color| { format!( "\x1b]{};rgb:{1:02x}{1:02x}/{2:02x}{2:02x}/{3:02x}{3:02x}{4}", - code, color.r, color.g, color.b, terminator + prefix, color.r, color.g, color.b, terminator ) }), )); |