diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-18 00:01:06 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-18 00:01:06 -0500 |
commit | 2472e512c344c77383b85714a343cf2b3ab5d637 (patch) | |
tree | 6c927717762a3b03a5d6d9956d19bb80173d512c /src/shell/history/mod.rs | |
parent | a7b16850f2437b015bcec8919586c4d4b070a35e (diff) | |
download | nbsh-2472e512c344c77383b85714a343cf2b3ab5d637.tar.gz nbsh-2472e512c344c77383b85714a343cf2b3ab5d637.zip |
don't just assume that an open fd 3 means to send status updates
now that we have subshells, we could have opened fd 3 on that subshell
via redirects or whatever
Diffstat (limited to 'src/shell/history/mod.rs')
-rw-r--r-- | src/shell/history/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shell/history/mod.rs b/src/shell/history/mod.rs index ad83e92..60979b6 100644 --- a/src/shell/history/mod.rs +++ b/src/shell/history/mod.rs @@ -283,7 +283,7 @@ async fn spawn_commands( event_w: async_std::channel::Sender<Event>, ) -> anyhow::Result<async_std::process::ExitStatus> { let mut cmd = pty_process::Command::new(std::env::current_exe()?); - cmd.args(&["-c", cmdline]); + cmd.args(&["-c", cmdline, "--status-fd", "3"]); env.apply(&mut cmd); let (from_r, from_w) = nix::unistd::pipe2(nix::fcntl::OFlag::O_CLOEXEC)?; // Safety: dup2 is an async-signal-safe function |