diff options
author | rbong <rbong@users.noreply.github.com> | 2019-06-02 09:16:38 -0400 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-06-02 13:16:38 +0000 |
commit | f79007035ccc8d52f5f491d35d3d4132aa29898d (patch) | |
tree | b48daf6974d0ad6bd2411ca41c08481a0369f371 /alacritty_terminal/src/term | |
parent | dea7a0890a724c50bc5767039f45a2e3d071ee1c (diff) | |
download | alacritty-f79007035ccc8d52f5f491d35d3d4132aa29898d.tar.gz alacritty-f79007035ccc8d52f5f491d35d3d4132aa29898d.zip |
Add foreground/background request escape codes
Diffstat (limited to 'alacritty_terminal/src/term')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index c01c159d..38f7f083 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1870,6 +1870,14 @@ impl ansi::Handler for Term { self.color_modified[index] = true; } + /// 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) { + trace!("Writing escape sequence for dynamic color code {}: color[{}]", code, index); + let color = self.colors[index]; + let _ = write!(writer, "\x1b]{};rgb:{:x}/{:x}/{:x}\x07", code, color.r, color.g, color.b); + } + /// Reset the indexed color to original value #[inline] fn reset_color(&mut self, index: usize) { |