Merge branch 'sharp/docker-stdin-tty' into 'master'

More fixes to stdin input.

See merge request veloren/veloren!2292
This commit is contained in:
Joshua Yanovski 2021-05-11 12:12:24 +00:00
commit 20911e8995
4 changed files with 10 additions and 1 deletions

7
Cargo.lock generated
View File

@ -4595,6 +4595,12 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "shell-words"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074"
[[package]] [[package]]
name = "shellexpand" name = "shellexpand"
version = "2.1.0" version = "2.1.0"
@ -5783,6 +5789,7 @@ dependencies = [
"num_cpus", "num_cpus",
"ron", "ron",
"serde", "serde",
"shell-words",
"signal-hook 0.3.8", "signal-hook 0.3.8",
"structopt", "structopt",
"tokio", "tokio",

View File

@ -35,6 +35,7 @@ structopt = "0.3.13"
crossterm = "0.19" crossterm = "0.19"
lazy_static = "1" lazy_static = "1"
signal-hook = "0.3.6" signal-hook = "0.3.6"
shell-words = "1.0.0"
tracing = { version = "0.1", default-features = false } tracing = { version = "0.1", default-features = false }
ron = {version = "0.6", default-features = false} ron = {version = "0.6", default-features = false}
serde = {version = "1.0", features = [ "rc", "derive" ]} serde = {version = "1.0", features = [ "rc", "derive" ]}

View File

@ -4,6 +4,7 @@ services:
game-server: game-server:
image: registry.gitlab.com/veloren/veloren/server-cli:nightly image: registry.gitlab.com/veloren/veloren/server-cli:nightly
stdin_open: true stdin_open: true
tty: true
container_name: veloren-game-server-master container_name: veloren-game-server-master
ports: ports:
- "14004:14004" - "14004:14004"

View File

@ -120,7 +120,7 @@ pub struct ArgvApp {
} }
pub fn parse_command(input: &str, msg_s: &mut Sender<Message>) { pub fn parse_command(input: &str, msg_s: &mut Sender<Message>) {
match TuiApp::from_iter_safe(input.split_whitespace()) { match TuiApp::from_iter_safe(shell_words::split(input).unwrap_or_default()) {
Ok(message) => { Ok(message) => {
msg_s msg_s
.send(message.command) .send(message.command)