diff --git a/app/src/executor.rs b/app/src/executor.rs index 67402d4f..56a082ce 100644 --- a/app/src/executor.rs +++ b/app/src/executor.rs @@ -108,6 +108,7 @@ impl Executor { "rename" => cx.manager.rename(), "shell" => cx.manager.shell( exec.named.contains_key("block"), + exec.named.contains_key("confirm"), exec.args.get(0).map(|s| s.as_str()).unwrap_or(""), ), "hidden" => cx.manager.current_mut().hidden(match exec.args.get(0).map(|s| s.as_str()) { diff --git a/core/src/manager/manager.rs b/core/src/manager/manager.rs index d580139b..20face77 100644 --- a/core/src/manager/manager.rs +++ b/core/src/manager/manager.rs @@ -225,12 +225,14 @@ impl Manager { pub fn bulk_rename(&self) -> bool { false } - pub fn shell(&self, block: bool, arg: &str) -> bool { + pub fn shell(&self, block: bool, confirm: bool, arg: &str) -> bool { let mut command = arg.to_string(); tokio::spawn(async move { - if command.is_empty() { - let result = emit!(Input(InputOpt::top("Shell:").with_highlight())); + if confirm || command.is_empty() { + let opt = InputOpt::top("Shell:").with_value(command.as_str()).with_highlight(); + let result = emit!(Input(opt)); + if let Ok(exec) = result.await { command = exec; }