Add bold_brightens_ansi_colors configuration option

refs: https://github.com/wez/wezterm/issues/244
This commit is contained in:
Wez Furlong committed 2020-07-18 09:02:56 -07:00
1 parent f2327de74d
commit 1209cde2b1
4 files changed
+28 -2

No files matched your search

+2
View File
@@ -14,6 +14,8 @@ brief notes about them may accumulate here.
(not multiplexer) terminal sessions.
* Added support for SGR 53/55 which enable/disable Overline style.
`printf "\x1b[53moverline\x1b[0m\n"`
* Added `bold_brightens_ansi_colors` option to allow disabling the automatic
brightening of bold text.
### 20200620-160318-e00b076c
+14
View File
@@ -27,6 +27,20 @@ return {
-- or notice slight differences when comparing with other terminal
-- emulators, you may wish to tune this value!
dpi = 96.0,
-- When true (the default), text that is set to ANSI color
-- indices 0-7 will be shifted to the corresponding brighter
-- color index (8-15) when the intensity is set to Bold.
--
-- This brightening effect doesn't occur when the text is set
-- to the default foreground color!
--
-- This defaults to true for better compatibility with a wide
-- range of mature software; for instance, a lot of software
-- assumes that Black+Bold renders as a Dark Grey which is
-- legible on a Black background, but if this option is set to
-- true, it would render as Black on Black.
bold_brightens_ansi_colors = true,
}
```
+6
View File
@@ -283,6 +283,12 @@ pub struct Config {
#[serde(default)]
pub font_rules: Vec<StyleRule>,
/// When true (the default), PaletteIndex 0-7 are shifted to
/// bright when the font intensity is bold. The brightening
/// doesn't apply to text that is the default color.
#[serde(default = "default_true")]
pub bold_brightens_ansi_colors: bool,
/// The color palette
pub colors: Option<Palette>,
+6 -2
View File
@@ -2312,7 +2312,9 @@ impl TermWindow {
params.palette.resolve_fg(attrs.foreground)
}
}
wezterm_term::color::ColorAttribute::PaletteIndex(idx) if idx < 8 => {
wezterm_term::color::ColorAttribute::PaletteIndex(idx)
if idx < 8 && params.config.bold_brightens_ansi_colors =>
{
// For compatibility purposes, switch to a brighter version
// of one of the standard ANSI colors when Bold is enabled.
// This lifts black to dark grey.
@@ -2599,7 +2601,9 @@ impl TermWindow {
palette.resolve_fg(attrs.foreground)
}
}
wezterm_term::color::ColorAttribute::PaletteIndex(idx) if idx < 8 => {
wezterm_term::color::ColorAttribute::PaletteIndex(idx)
if idx < 8 && config.bold_brightens_ansi_colors =>
{
// For compatibility purposes, switch to a brighter version
// of one of the standard ANSI colors when Bold is enabled.
// This lifts black to dark grey.