diff options
author | quentin konieczko <konieczko@gmail.com> | 2023-04-12 07:09:23 +0200 |
---|---|---|
committer | quentin konieczko <konieczko@gmail.com> | 2023-04-12 07:09:23 +0200 |
commit | 4fb5f277cc1ea59fe1b998db07fdc8a077c6ac71 (patch) | |
tree | 269196b45751a0280f11986a235ae0714eee3cd0 /src/event_exec.rs | |
parent | fcdcca85ed9bebe4ec12d78867ff522a7d1e0441 (diff) |
not working
Diffstat (limited to 'src/event_exec.rs')
-rw-r--r-- | src/event_exec.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/event_exec.rs b/src/event_exec.rs index dcb1050..482866d 100644 --- a/src/event_exec.rs +++ b/src/event_exec.rs @@ -354,26 +354,24 @@ impl EventExec { /// pipes and redirections aren't NotSupported /// expansions are supported pub fn exec_shell(status: &mut Status) -> Result<()> { - let tab = status.selected_non_mut(); - let shell_command = tab.input.string(); + let dir = status + .selected_non_mut() + .directory_of_selected()? + .to_owned(); + let shell_command = status.selected_non_mut().input.string(); let mut args = ShellCommandParser::new(shell_command).compute(status)?; if args.is_empty() { return Ok(()); } - let executable = args.remove(0); + let mut executable = args.remove(0); if Self::is_sudo_command(&executable) { - let mut pwm = PasswordHolder::default(); - Self::event_ask_password(status, PasswordKind::SUDO, None, PasswordUsage::SUDOCOMMAND)?; - return Ok(()); + executable = args.remove(0); + // return Ok(()); } let Ok(executable) = which::which(executable) else { return Ok(()); }; let params: Vec<&str> = args.iter().map(|s| s.as_str()).collect(); - execute_in_child_without_output_with_path( - executable, - tab.directory_of_selected()?, - Some(¶ms), - )?; + execute_in_child_without_output_with_path(executable, dir, Some(¶ms))?; Ok(()) } |