don't split terminal command

This commit is contained in:
Dongdong Zhou 2023-10-20 21:40:13 +01:00
parent 938ee96a8e
commit 82d30986e6
1 changed files with 6 additions and 10 deletions

View File

@ -251,18 +251,14 @@ fn program(profile: &TerminalProfile) -> Option<Program> {
} else { } else {
None None
} }
} else { } else if which::which(command).is_ok() {
let mut parts = command.split(' ');
let program = parts.next().unwrap();
if which::which(program).is_ok() {
Some(Program::WithArgs { Some(Program::WithArgs {
program: program.to_string(), program: command.to_owned(),
args: parts.map(|p| p.to_string()).collect::<Vec<String>>(), args: Vec::new(),
}) })
} else { } else {
None None
} }
}
} else { } else {
None None
} }