From 6d7b7137e2c955802c45dcc4d0bd3a0ff0afc5cb Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 30 Jan 2023 15:10:16 -0800 Subject: [PATCH] helix-term: expand upon why we need to SIGSTOP the entire process group Also add a link back to one of the upstream issues. --- helix-term/src/application.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index f63aa6d0c300..281c923c1f84 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -454,6 +454,13 @@ impl Application { // A pid of 0 sends the signal to the entire process group, allowing the user to // regain control of their terminal if the editor was spawned under another process // (e.g. when running `git commit`). + // + // We have to send SIGSTOP (not SIGTSTP) to the entire process group, because, + // as mentioned above, the terminal will get stuck if `helix` was spawned from + // an external process and that process waits for `helix` to complete. This may + // be an issue with signal-hook-tokio, but the author of signal-hook believes it + // could be a tokio issue instead: + // https://github.com/vorner/signal-hook/issues/132 libc::kill(0, signal::SIGSTOP) };