From 98617b70d8e85053c1ca56f26c58d49d880a0ce1 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 8 Jan 2022 14:58:23 -0500 Subject: remove pipeline from the environment it was only really here for convenience, but it doesn't really make a lot of sense --- src/shell/history/mod.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/shell/history/mod.rs') diff --git a/src/shell/history/mod.rs b/src/shell/history/mod.rs index 9e1d1fd..55f2d8a 100644 --- a/src/shell/history/mod.rs +++ b/src/shell/history/mod.rs @@ -300,8 +300,14 @@ fn run_commands( }; for pipeline in ast.pipelines() { - env.set_pipeline(pipeline.input_string().to_string()); - match run_pipeline(&pty, &mut env, event_w.clone()).await { + match run_pipeline( + pipeline.input_string(), + &pty, + &mut env, + event_w.clone(), + ) + .await + { Ok((pipeline_status, done)) => { env.set_status(pipeline_status); if done { @@ -326,6 +332,7 @@ fn run_commands( } async fn run_pipeline( + pipeline: &str, pty: &pty::Pty, env: &mut Env, event_w: async_std::channel::Sender, @@ -352,6 +359,9 @@ async fn run_pipeline( // Safety: to_w was just opened above, was not used until now, and can't // be used after this because we rebound the variable let mut to_w = unsafe { async_std::fs::File::from_raw_fd(to_w) }; + to_w.write_all(&bincode::serialize(pipeline).unwrap()) + .await + .unwrap(); to_w.write_all(&env.as_bytes()).await.unwrap(); drop(to_w); -- cgit v1.2.3-54-g00ecf