diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-03 01:45:24 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-03 01:46:28 -0500 |
commit | b2874e0a14920f1b4efe515178b2bfa90b756d4d (patch) | |
tree | 9e6847d845703533a71b89bb8a2e6ca48ec47849 /src/state/history/mod.rs | |
parent | 234d71241399ae40d498d7953e9516f5cc5a471c (diff) | |
download | nbsh-b2874e0a14920f1b4efe515178b2bfa90b756d4d.tar.gz nbsh-b2874e0a14920f1b4efe515178b2bfa90b756d4d.zip |
pass the latest status back and forth
Diffstat (limited to 'src/state/history/mod.rs')
-rw-r--r-- | src/state/history/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/state/history/mod.rs b/src/state/history/mod.rs index 3ff342c..7423727 100644 --- a/src/state/history/mod.rs +++ b/src/state/history/mod.rs @@ -99,7 +99,7 @@ impl History { run_commands( ast.clone(), async_std::sync::Arc::clone(&entry), - crate::command::Env::new(), + crate::command::Env::new(0), input_r, resize_r, event_w, @@ -575,10 +575,13 @@ async fn run_pipeline( nix::unistd::close(r).unwrap(); let mut w = unsafe { async_std::fs::File::from_raw_fd(w) }; + // TODO: actual serialization + w.write_all(&env.latest_status().code().unwrap_or(1).to_be_bytes()) + .await + .unwrap(); w.write_all(pipeline.input_string().as_bytes()) .await .unwrap(); - // todo: write contents of env also drop(w); let status = child.status_no_drop().await.unwrap(); |