diff options
author | RĂ©mi Garde <remi.garde@free.fr> | 2018-07-23 18:48:27 +0200 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-07-23 16:48:27 +0000 |
commit | d25134bc6b8b13d5ff550c950c65b6e9c4a7a267 (patch) | |
tree | 1742ed9d0613b018d147e54055da7dd2c518430d /src/term/mod.rs | |
parent | ea512cb0f3cb159707eb29fdbf2e31bbb1c1b902 (diff) | |
download | alacritty-d25134bc6b8b13d5ff550c950c65b6e9c4a7a267.tar.gz alacritty-d25134bc6b8b13d5ff550c950c65b6e9c4a7a267.zip |
Add optional dim foreground color
Add optional color for the dim foreground (`\e[2m;`)
Defaults to 2/3 of the foreground color. (same as other colors).
If a bright color is dimmed, it's displayed as the normal color. The
exception for this is when the bright foreground is dimmed when no
bright foreground color is set. In that case it's treated as a normal
foreground color and dimmed to DimForeground.
To minimize the surprise for the user, the bright and dim colors have
been completely removed from the default configuration file.
Some documentation has also been added to make it clear to users what
these options can be used for.
This fixes #1448.
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 02d846a4..fd22fe54 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -275,11 +275,18 @@ impl<'a> RenderableCellsIter<'a> { Color::Spec(rgb) => rgb, Color::Named(ansi) => { match (self.config.draw_bold_text_with_bright_colors(), cell.flags & Flags::DIM_BOLD) { + // If no bright foreground is set, treat it like the BOLD flag doesn't exist + (_, self::cell::Flags::DIM_BOLD) + if ansi == NamedColor::Foreground + && self.config.colors().primary.bright_foreground.is_none() => + { + self.colors[NamedColor::DimForeground] + } // Draw bold text in bright colors *and* contains bold flag. - (true, self::cell::Flags::DIM_BOLD) | - (true, self::cell::Flags::BOLD) => self.colors[ansi.to_bright()], + (true, self::cell::Flags::BOLD) => self.colors[ansi.to_bright()], // Cell is marked as dim and not bold - (_, self::cell::Flags::DIM) => self.colors[ansi.to_dim()], + (_, self::cell::Flags::DIM) | + (false, self::cell::Flags::DIM_BOLD) => self.colors[ansi.to_dim()], // None of the above, keep original color. _ => self.colors[ansi] } |