diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-01-31 00:00:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-31 00:00:23 +0000 |
commit | 2ef5e47b8e8591d9df5e3198daad9308b7851343 (patch) | |
tree | 5c1d4b9c6f7e88380c396e638666e3b58e25f2da /alacritty_terminal/src/term/mod.rs | |
parent | 7f4dce2ee04859fb0b48f15cf808b60065778703 (diff) | |
download | alacritty-2ef5e47b8e8591d9df5e3198daad9308b7851343.tar.gz alacritty-2ef5e47b8e8591d9df5e3198daad9308b7851343.zip |
Mirror OSC query terminator
Fixes #3091.
Diffstat (limited to 'alacritty_terminal/src/term/mod.rs')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index eeacbf7f..ddba07ef 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1739,12 +1739,18 @@ impl<T: EventListener> Handler for Term<T> { /// Write a foreground/background color escape sequence with the current color #[inline] - fn dynamic_color_sequence<W: io::Write>(&mut self, writer: &mut W, code: u8, index: usize) { + fn dynamic_color_sequence<W: io::Write>( + &mut self, + writer: &mut W, + code: u8, + index: usize, + terminator: &str, + ) { trace!("Writing escape sequence for dynamic color code {}: color[{}]", code, index); let color = self.colors[index]; let response = format!( - "\x1b]{};rgb:{1:02x}{1:02x}/{2:02x}{2:02x}/{3:02x}{3:02x}\x07", - code, color.r, color.g, color.b + "\x1b]{};rgb:{1:02x}{1:02x}/{2:02x}{2:02x}/{3:02x}{3:02x}{4}", + code, color.r, color.g, color.b, terminator ); let _ = writer.write_all(response.as_bytes()); } @@ -1775,7 +1781,7 @@ impl<T: EventListener> Handler for Term<T> { /// Write clipboard data to child. #[inline] - fn write_clipboard<W: io::Write>(&mut self, clipboard: u8, writer: &mut W) { + fn write_clipboard<W: io::Write>(&mut self, clipboard: u8, writer: &mut W, terminator: &str) { let clipboard_type = match clipboard { b'c' => ClipboardType::Clipboard, b'p' | b's' => ClipboardType::Selection, @@ -1784,7 +1790,7 @@ impl<T: EventListener> Handler for Term<T> { let text = self.clipboard.load(clipboard_type); let base64 = base64::encode(&text); - let escape = format!("\x1b]52;{};{}\x07", clipboard as char, base64); + let escape = format!("\x1b]52;{};{}{}", clipboard as char, base64, terminator); let _ = writer.write_all(escape.as_bytes()); } |