summaryrefslogtreecommitdiffstats
path: root/src/runner/mod.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-17 00:35:49 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-17 01:23:08 -0500
commit51b30ef54d2953a89edda966f10f150b7ef81ee5 (patch)
tree253bfd8095f15497ddb2e8104f46173d5b1092db /src/runner/mod.rs
parent296fa4ce873c158b8c87d21db3e566c8ae365504 (diff)
downloadnbsh-51b30ef54d2953a89edda966f10f150b7ef81ee5.tar.gz
nbsh-51b30ef54d2953a89edda966f10f150b7ef81ee5.zip
fix cd history
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(())
}