diff --git a/crates/nu-protocol/src/engine/engine_state.rs b/crates/nu-protocol/src/engine/engine_state.rs index ec616c3403..71c1a58905 100644 --- a/crates/nu-protocol/src/engine/engine_state.rs +++ b/crates/nu-protocol/src/engine/engine_state.rs @@ -320,6 +320,10 @@ impl EngineState { } } + let cwd = self.cwd(Some(stack))?; + // TODO: better error + std::env::set_current_dir(cwd)?; + if let Some(config) = stack.config.take() { // If config was updated in the stack, replace it. self.config = config;