diff --git a/crates/television/app.rs b/crates/television/app.rs index a292719..612135f 100644 --- a/crates/television/app.rs +++ b/crates/television/app.rs @@ -45,6 +45,7 @@ pub struct App { #[derive(Debug)] pub enum ActionOutcome { Entry(Entry), + Input(String), Passthrough(Entry, String), None, } @@ -63,6 +64,10 @@ impl From for AppOutput { selected_entry: Some(entry), passthrough: None, }, + ActionOutcome::Input(input) => Self { + selected_entry: None, + passthrough: Some(input), + }, ActionOutcome::Passthrough(entry, key) => Self { selected_entry: Some(entry), passthrough: Some(key), @@ -261,7 +266,9 @@ impl App { { return Ok(ActionOutcome::Entry(entry)); } - return Ok(ActionOutcome::None); + return Ok(ActionOutcome::Input( + self.television.lock().await.current_pattern.clone(), + )); } Action::SelectPassthrough(passthrough) => { self.should_quit = true; diff --git a/crates/television/television.rs b/crates/television/television.rs index d2a0cf9..3be2b55 100644 --- a/crates/television/television.rs +++ b/crates/television/television.rs @@ -38,7 +38,7 @@ pub struct Television { pub(crate) channel: TelevisionChannel, pub(crate) remote_control: TelevisionChannel, pub mode: Mode, - current_pattern: String, + pub current_pattern: String, pub(crate) results_picker: Picker, pub(crate) rc_picker: Picker, results_area_height: u32, @@ -358,6 +358,11 @@ impl Television { self.change_channel(new_channel); } } + } else { + self.action_tx + .as_ref() + .unwrap() + .send(Action::SelectAndExit)?; } } Action::CopyEntryToClipboard => {