From 7279e431416673716b217ab16ed238ad082812f1 Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 19 Mar 2024 11:27:20 +0800 Subject: fix: color on non-truecolor terminal (#363) * fix: color on non-truecolor terminal * make ansicolor lower contrast --- src/config/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index 1c7fa8a..548a0b2 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -737,7 +737,11 @@ impl Config { } else { None }; - Ok(RenderOptions::new(theme, wrap, self.wrap_code)) + let truecolor = matches!( + env::var("COLORTERM").as_ref().map(|v| v.as_str()), + Ok("truecolor") + ); + Ok(RenderOptions::new(theme, wrap, self.wrap_code, truecolor)) } pub fn render_prompt_left(&self) -> String { -- cgit v1.2.3