From 34934733b364ed460c647f1775f5865048833f54 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 13 Mar 2023 05:08:57 -0700 Subject: helix-term: send the STOP signal to all processes in the process group (#3546) * helix-term: send the STOP signal to all processes in the process group From kill(3p): If pid is 0, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the process group ID of the sender, and for which the process has permission to send a signal. This fixes the issue of running `git commit`, attempting to suspend helix with ^Z, and then not regaining control over the terminal and having to press ^Z again. * helix-term: use libc directly to send STOP signal * helix-term: document safety of libc::kill * helix-term: properly handle libc::kill's failure I misread the manpage for POSIX `kill` -- it returns `-1` in the failure case, and sets `errno`, which is retrieved via `std::io::Error::last_os_error()`, has its string representation printed out, and then exits with the matching status code (or 1 if, for whatever reason, there is no matching status code). * helix-term: expand upon why we need to SIGSTOP the entire process group Also add a link back to one of the upstream issues.--- Cargo.lock | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index de985bca..70d3eaef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1177,6 +1177,7 @@ dependencies = [ "helix-view", "ignore", "indoc", + "libc", "log", "once_cell", "pulldown-cmark", -- cgit v1.2.3-70-g09d2