From d387ebe1d7fe9f9fe9d840039aba68efffe5a233 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 19 Sep 2018 19:18:51 +0000 Subject: Add hidden escape sequence This adds support for the `hidden` escape sequence `\e[8m`, which will render the text as invisible. This has also raised a few questions about the rendering of foreground and background colors and their interaction with the different escape sequences. Previously, Alacritty has oriented itself after URxvt, which has some strange and unexpected behavior. The new implementation of color inversion is modeled after XTerm, which has a consistent pattern of always inverting the foreground and background colors. This should hopefully lead to less confusion for the user and a more consistent behavior. A full matrix showcasing the new way Alacritty inverses text can be found here: https://i.imgur.com/d1XavG7.png This fixes #1454 and fixes #1455. --- src/renderer/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/renderer/mod.rs') diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 68335e1c..b461db0c 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -835,12 +835,17 @@ impl<'a> RenderApi<'a> { glyph_cache.font_key }; - let glyph_key = GlyphKey { + let mut glyph_key = GlyphKey { font_key, size: glyph_cache.font_size, c: cell.c }; + // Don't render text of HIDDEN cells + if cell.flags.contains(cell::Flags::HIDDEN) { + glyph_key.c = ' '; + } + // Add cell to batch { let glyph = glyph_cache.get(glyph_key, self); -- cgit v1.2.3