fix: edge case with only sudo command

This commit is contained in:
iff 2024-12-05 20:03:12 +01:00
parent c99c736ad5
commit 94d011cdd1
2 changed files with 9 additions and 3 deletions

View file

@ -273,8 +273,14 @@ pub fn confirm_suggestion(shell: &str, command: &str, highlighted: &str) -> Resu
if !command.starts_with(&_p) {
continue;
}
let mut command = command.replacen(&_p, "", 1);
command = expand_alias_multiline(shell, &command);
let command = {
let mut command = command.replacen(&_p, "", 1);
if command != " " {
command = expand_alias_multiline(shell, &command);
}
command
};
let now = Instant::now();
let process = run_suggestion_p(shell, p, &command);