diff --git a/Cargo.lock b/Cargo.lock index 74374912a7..3f514d5816 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -776,11 +776,12 @@ checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7" [[package]] name = "dialoguer" -version = "0.10.1" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c8ae48e400addc32a8710c8d62d55cb84249a7d58ac4cd959daecfbaddc545" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" dependencies = [ "console", + "shell-words", "tempfile", "zeroize", ] @@ -2596,6 +2597,12 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shellexpand" version = "3.0.0" diff --git a/zellij-server/src/pty.rs b/zellij-server/src/pty.rs index ea2d4fe44c..fb58aef8bd 100644 --- a/zellij-server/src/pty.rs +++ b/zellij-server/src/pty.rs @@ -742,7 +742,7 @@ impl Pty { } }); match run_instruction { - Some(Run::Command(command)) => { + Some(Run::Command(mut command)) => { let starts_held = command.hold_on_start; let hold_on_close = command.hold_on_close; let quit_cb = Box::new({ @@ -762,6 +762,11 @@ impl Pty { } } }); + if command.cwd.is_none() { + if let TerminalAction::RunCommand(cmd) = default_shell { + command.cwd = cmd.cwd; + } + } let cmd = TerminalAction::RunCommand(command.clone()); if starts_held { // we don't actually open a terminal in this case, just wait for the user to run it