fix: skip terminal color-scheme queries in test builds

This commit is contained in:
Dark-Alex-17 committed 2026-09-03 12:35:12 -06:00
1 parent c8af77b36f
commit 49bd5d86b4
1 file changed
+4 -1
+4 -1
View File
@@ -640,7 +640,10 @@ impl AppConfig {
if self.highlight && self.theme.is_none() { if self.highlight && self.theme.is_none() {
if let Some(v) = super::read_env_value::<String>(&get_env_name("theme")) { if let Some(v) = super::read_env_value::<String>(&get_env_name("theme")) {
self.theme = v; self.theme = v;
} else if *IS_STDOUT_TERMINAL { } else if !cfg!(test) && *IS_STDOUT_TERMINAL {
// Never query the terminal from test builds: the test harness
// shares the process TTY, so parallel raw-mode color queries
// garble the runner's output and stall on stolen replies.
if let Ok(color_scheme) = color_scheme(QueryOptions::default()) { if let Ok(color_scheme) = color_scheme(QueryOptions::default()) {
let theme = match color_scheme { let theme = match color_scheme {
ColorScheme::Dark => "dark", ColorScheme::Dark => "dark",