about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-29 13:13:00 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-29 13:24:58 +0100
commit619d5296dbfc77c37c13b86e4e96c356f1c3f61a (patch)
tree3f4c265b6eb142159a98874efa814277ece3dc89
parentf9c74eac1260cd02302a70adaa4806c297428163 (diff)
downloadchawan-619d5296dbfc77c37c13b86e4e96c356f1c3f61a.tar.gz
client: stop entire process group on suspend()
* pass 0 so e.g. git does not hang
* use sigtstp so e.g. cgi scripts can clean up if needed
-rw-r--r--doc/config.md5
-rw-r--r--src/local/client.nim2
2 files changed, 4 insertions, 3 deletions
diff --git a/doc/config.md b/doc/config.md
index 58a07823..7c7ca27d 100644
--- a/doc/config.md
+++ b/doc/config.md
@@ -657,8 +657,9 @@ A list of built-in pager functions can be found below.
 <tr>
 <td>`suspend()`</td>
 <td>Temporarily suspend the browser (by delivering the client process a
-SIGSTOP signal.)<br>
-Note: this does not suspend buffer processes.</td>
+SIGTSTP signal.)<br>
+Note: this suspends the entire process group, including e.g. buffer processes or
+CGI scripts.</td>
 </tr>
 
 </table>
diff --git a/src/local/client.nim b/src/local/client.nim
index 960e2f1a..efc838f4 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -154,7 +154,7 @@ proc command(client: Client, src: string) =
 
 proc suspend(client: Client) {.jsfunc.} =
   client.pager.term.quit()
-  discard kill(client.mainproc, cint(SIGSTOP))
+  discard kill(0, cint(SIGTSTP))
   client.pager.term.restart()
 
 proc quit(client: Client, code = 0) {.jsfunc.} =