diff --git a/.config/config.toml b/.config/config.toml index 4359fdb..341db38 100644 --- a/.config/config.toml +++ b/.config/config.toml @@ -57,7 +57,7 @@ ui_scale = 100 # Where to place the input bar in the UI (top or bottom) input_bar_position = "top" # The input prompt string (defaults to ">" if not specified) -# input_prompt = ">" +input_prompt = ">" # What orientation should tv be (landscape or portrait) orientation = "landscape" # The theme to use for the UI diff --git a/television/channels/prototypes.rs b/television/channels/prototypes.rs index 4a05d5f..41be5a0 100644 --- a/television/channels/prototypes.rs +++ b/television/channels/prototypes.rs @@ -402,7 +402,7 @@ impl From<&crate::config::UiConfig> for UiSpec { orientation: Some(config.orientation), input_bar_position: Some(config.input_bar_position), input_header: config.input_header.clone(), - input_prompt: config.input_prompt.clone(), + input_prompt: Some(config.input_prompt.clone()), preview_panel: Some(config.preview_panel.clone()), status_bar: Some(config.status_bar.clone()), help_panel: Some(config.help_panel.clone()), diff --git a/television/cli/args.rs b/television/cli/args.rs index 128dd63..aa0e9fe 100644 --- a/television/cli/args.rs +++ b/television/cli/args.rs @@ -147,7 +147,7 @@ pub struct Cli { /// When no channel is specified: Sets the input prompt for the ad-hoc channel. /// /// The given value is used as the prompt string shown before the input field. - /// Defaults to "> " when omitted. + /// Defaults to ">" when omitted. #[arg(long = "input-prompt", value_name = "STRING", verbatim_doc_comment)] pub input_prompt: Option, diff --git a/television/config/mod.rs b/television/config/mod.rs index fabf0c1..661c41b 100644 --- a/television/config/mod.rs +++ b/television/config/mod.rs @@ -268,7 +268,7 @@ impl Config { // Apply input_prompt if let Some(value) = &ui_spec.input_prompt { - self.ui.input_prompt = Some(value.clone()); + self.ui.input_prompt.clone_from(value); } // Handle preview_panel with field merging @@ -488,7 +488,7 @@ mod tests { const USER_CONFIG_INPUT_PROMPT: &str = r#" [ui] - input_prompt = "❯ " + input_prompt = "❯" "#; #[test] @@ -507,7 +507,7 @@ mod tests { let config = Config::new(&config_env, None).unwrap(); // Verify that input_prompt was loaded from user config - assert_eq!(config.ui.input_prompt, Some("❯ ".to_string())); + assert_eq!(config.ui.input_prompt, "❯"); } #[test] diff --git a/television/config/ui.rs b/television/config/ui.rs index 654d9ef..55ae396 100644 --- a/television/config/ui.rs +++ b/television/config/ui.rs @@ -108,7 +108,8 @@ pub struct UiConfig { pub orientation: Orientation, pub theme: String, pub input_header: Option