diff --git a/Cargo.lock b/Cargo.lock index 1ff27e939b..fd55c47fdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4595,6 +4595,12 @@ dependencies = [ "libc", ] +[[package]] +name = "shell-words" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074" + [[package]] name = "shellexpand" version = "2.1.0" @@ -5783,6 +5789,7 @@ dependencies = [ "num_cpus", "ron", "serde", + "shell-words", "signal-hook 0.3.8", "structopt", "tokio", diff --git a/server-cli/Cargo.toml b/server-cli/Cargo.toml index a2563f89c1..5efc0363c6 100644 --- a/server-cli/Cargo.toml +++ b/server-cli/Cargo.toml @@ -35,6 +35,7 @@ structopt = "0.3.13" crossterm = "0.19" lazy_static = "1" signal-hook = "0.3.6" +shell-words = "1.0.0" tracing = { version = "0.1", default-features = false } ron = {version = "0.6", default-features = false} serde = {version = "1.0", features = [ "rc", "derive" ]} diff --git a/server-cli/docker-compose.yml b/server-cli/docker-compose.yml index c9c58f2061..6faf73fb84 100644 --- a/server-cli/docker-compose.yml +++ b/server-cli/docker-compose.yml @@ -4,6 +4,7 @@ services: game-server: image: registry.gitlab.com/veloren/veloren/server-cli:nightly stdin_open: true + tty: true container_name: veloren-game-server-master ports: - "14004:14004" diff --git a/server-cli/src/cli.rs b/server-cli/src/cli.rs index 0e03158d2f..eb5eeeb0c6 100644 --- a/server-cli/src/cli.rs +++ b/server-cli/src/cli.rs @@ -120,7 +120,7 @@ pub struct ArgvApp { } pub fn parse_command(input: &str, msg_s: &mut Sender) { - match TuiApp::from_iter_safe(input.split_whitespace()) { + match TuiApp::from_iter_safe(shell_words::split(input).unwrap_or_default()) { Ok(message) => { msg_s .send(message.command)