From e838166b16082184bd9afb7e0a39bf8404b4f8dc Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Tue, 7 Apr 2026 17:04:55 +0000 Subject: [PATCH] [F] Fix background color detection timeout (#453) --- crates/hyfetch/src/bin/hyfetch.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/hyfetch/src/bin/hyfetch.rs b/crates/hyfetch/src/bin/hyfetch.rs index e23192bb..ae37410a 100644 --- a/crates/hyfetch/src/bin/hyfetch.rs +++ b/crates/hyfetch/src/bin/hyfetch.rs @@ -268,15 +268,15 @@ fn det_bg() -> Result>, terminal_colorsaurus::Error> { return Ok(None); } - background_color(QueryOptions::default()) - .map(|terminal_colorsaurus::Color { r, g, b , .. }| Some(Srgb::new(r, g, b).into_format())) - .or_else(|err| { - if matches!(err, terminal_colorsaurus::Error::UnsupportedTerminal(_)) { - Ok(None) - } else { - Err(err) - } - }) + match background_color(QueryOptions::default()) { + Ok(terminal_colorsaurus::Color { r, g, b, .. }) => { + Ok(Some(Srgb::new(r, g, b).into_format())) + } + Err(err) => { + debug!(?err, "failed to detect background color"); + Ok(None) + } + } } /// Creates config interactively.