summaryrefslogtreecommitdiffstats
path: root/src/runner/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/runner/mod.rs')
-rw-r--r--src/runner/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runner/mod.rs b/src/runner/mod.rs
index 48d66ad..0f02ef0 100644
--- a/src/runner/mod.rs
+++ b/src/runner/mod.rs
@@ -211,11 +211,15 @@ async fn run_pipeline(
io.set_stdout(stdout);
io.set_stderr(stderr);
+ let pwd = env.pwd().to_path_buf();
let (children, pg) = spawn_children(pipeline, env, &io)?;
let status = wait_children(children, pg, env, &io, shell_write).await;
set_foreground_pg(nix::unistd::getpid())?;
env.update()?;
env.set_status(status);
+ if env.pwd() != pwd {
+ env.set_prev_pwd(pwd);
+ }
Ok(())
}