[F] Fix background color detection timeout (#453)

This commit is contained in:
2026-04-07 17:04:55 +00:00
parent 43e1dc1067
commit e838166b16
+9 -9
View File
@@ -268,15 +268,15 @@ fn det_bg() -> Result<Option<Srgb<u8>>, terminal_colorsaurus::Error> {
return Ok(None); return Ok(None);
} }
background_color(QueryOptions::default()) match background_color(QueryOptions::default()) {
.map(|terminal_colorsaurus::Color { r, g, b , .. }| Some(Srgb::new(r, g, b).into_format())) Ok(terminal_colorsaurus::Color { r, g, b, .. }) => {
.or_else(|err| { Ok(Some(Srgb::new(r, g, b).into_format()))
if matches!(err, terminal_colorsaurus::Error::UnsupportedTerminal(_)) { }
Ok(None) Err(err) => {
} else { debug!(?err, "failed to detect background color");
Err(err) Ok(None)
} }
}) }
} }
/// Creates config interactively. /// Creates config interactively.