terminal init properly lexes init command

This commit is contained in:
mbecker20
2025-10-27 21:01:15 -07:00
parent bc672d9649
commit 3e3def03ec

View File

@@ -256,13 +256,15 @@ impl PeripheryTerminal {
.openpty(PtySize::default())
.context("Failed to open terminal")?;
let mut command_split = command.split(' ').map(|arg| arg.trim());
let cmd =
command_split.next().context("Command cannot be empty")?;
let mut lexed = shlex::split(&command)
.context("Invalid command: empty")?
.into_iter();
let cmd = lexed.next().context("Command cannot be empty")?;
let mut cmd = CommandBuilder::new(cmd);
for arg in command_split {
for arg in lexed {
cmd.arg(arg);
}