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