@@ -276,12 +276,27 @@ pub mod provider {
276 let stdin = input.map(|_| Stdio::piped()).unwrap_or_else(Stdio::null);
276 let stdin = input.map(|_| Stdio::piped()).unwrap_or_else(Stdio::null);
277 let stdout = pipe_output.then(Stdio::piped).unwrap_or_else(Stdio::null);
277 let stdout = pipe_output.then(Stdio::piped).unwrap_or_else(Stdio::null);
279− let mut child = Command::new(self.prg)
279+ let mut command: Command = Command::new(self.prg);
281+ let mut command_mut: &mut Command = command
280 .args(self.args)
282 .args(self.args)
281 .stdin(stdin)
283 .stdin(stdin)
282 .stdout(stdout)
284 .stdout(stdout)
283− .stderr(Stdio::null())
285+ .stderr(Stdio::null());
287+ // Fix for https://github.com/helix-editor/helix/issues/5424
289+ use std::os::unix::process::CommandExt;
292+ command_mut = command_mut.pre_exec(|| match libc::setsid() {
293+ -1 => Err(std::io::Error::last_os_error()),
299+ let mut child = command_mut.spawn()?;
286 if let Some(input) = input {
301 if let Some(input) = input {
287 let mut stdin = child.stdin.take().context("stdin is missing")?;
302 let mut stdin = child.stdin.take().context("stdin is missing")?;