diff --git a/crates/television-channels/src/entry.rs b/crates/television-channels/src/entry.rs index 1aa3489..779dee3 100644 --- a/crates/television-channels/src/entry.rs +++ b/crates/television-channels/src/entry.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use devicons::FileIcon; // NOTE: having an enum for entry types would be nice since it would allow @@ -92,7 +94,9 @@ impl Entry { pub fn stdout_repr(&self) -> String { let mut repr = self.name.clone(); - if repr.contains(|c| char::is_ascii_whitespace(&c)) { + if PathBuf::from(&repr).exists() + && repr.contains(|c| char::is_ascii_whitespace(&c)) + { repr.insert(0, '\''); repr.push('\''); } diff --git a/crates/television/config/ui.rs b/crates/television/config/ui.rs index a614b5d..0c56f8a 100644 --- a/crates/television/config/ui.rs +++ b/crates/television/config/ui.rs @@ -11,6 +11,7 @@ pub struct UiConfig { pub use_nerd_font_icons: bool, pub ui_scale: u16, pub show_help_bar: bool, + #[serde(default)] pub input_bar_position: InputPosition, }