diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-09 22:31:19 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-09 22:31:19 -0500 |
commit | f75dda7269a8ac69f16db86c6a7914bbf97a9ddf (patch) | |
tree | 8242eb7162973c33edfdad04e662d098aac906ac | |
parent | 86e27af63289d7b7687a0e9714463ad0b240eb2e (diff) | |
download | nbsh-f75dda7269a8ac69f16db86c6a7914bbf97a9ddf.tar.gz nbsh-f75dda7269a8ac69f16db86c6a7914bbf97a9ddf.zip |
restore session leader to the foreground process on process group exit
this way it can catch ^C etc
-rw-r--r-- | src/pipeline/mod.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs index 51f1987..7f8ac03 100644 --- a/src/pipeline/mod.rs +++ b/src/pipeline/mod.rs @@ -209,6 +209,7 @@ async fn run_pipeline( 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.set_status(status); Ok(()) } |