fix: pass full command string to exec, not just the first word

The `Exec` arm of `Command::from_str` only captured the first
whitespace-delimited token, silently dropping all arguments.
Now passes the entire input string so e.g. `ls -la /tmp` works.
This commit is contained in:
Christian Visintin
2026-03-21 10:44:43 +01:00
parent d4bf9cc4a6
commit 36a830c8cc

View File

@@ -30,7 +30,7 @@ impl FromStr for Command {
}
}
Some("exit") | Some("logout") => Ok(Command::Exit),
Some(cmd) => Ok(Command::Exec(cmd.to_string())),
Some(_) => Ok(Command::Exec(s.to_string())),
None => Err("".to_string()),
}
}