From 2472e512c344c77383b85714a343cf2b3ab5d637 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 18 Jan 2022 00:01:06 -0500 Subject: 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 --- src/shell/history/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shell/history/mod.rs') 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, ) -> anyhow::Result { 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 -- cgit v1.2.3-54-g00ecf