mirror of
https://github.com/hykilpikonna/hyfetch.git
synced 2026-05-06 05:25:31 -05:00
[F] Fix background color detection timeout (#453)
This commit is contained in:
parent
43e1dc1067
commit
e838166b16
|
|
@ -268,15 +268,15 @@ fn det_bg() -> Result<Option<Srgb<u8>>, 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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user