From c5f4e65942e5ac64c0d5de22f3e257588c58960f Mon Sep 17 00:00:00 2001 From: Alex Flores Date: Tue, 15 Jul 2025 23:31:31 -0500 Subject: [PATCH] feat(config): add support for custom input prompt in user config - Allow users to specify a custom input prompt string via the `input_prompt` setting in the configuration file. - Document the new `input_prompt` option in `.config/config.toml` with a commented example. - Add a test to ensure that the input prompt is correctly loaded from the user configuration file. --- .config/config.toml | 2 ++ television/channels/prototypes.rs | 3 ++ television/cli/args.rs | 10 ++++++ television/cli/mod.rs | 3 ++ television/config/mod.rs | 29 ++++++++++++++++ television/config/ui.rs | 2 ++ television/draw.rs | 6 ++++ television/main.rs | 11 ++++++ television/screen/input.rs | 5 +-- tests/cli/cli_ui.rs | 57 +++++++++++++++++++++++++++++++ 10 files changed, 126 insertions(+), 2 deletions(-) diff --git a/.config/config.toml b/.config/config.toml index 6b80d02..4359fdb 100644 --- a/.config/config.toml +++ b/.config/config.toml @@ -56,6 +56,8 @@ 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 = ">" # 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 c18af81..4a05d5f 100644 --- a/television/channels/prototypes.rs +++ b/television/channels/prototypes.rs @@ -379,6 +379,8 @@ pub struct UiSpec { pub input_bar_position: Option, #[serde(default)] pub input_header: Option