Skip to content

Commit ca192a8

Browse files
authored
Fix suspending with process groups (#49)
Since using raw mode via `raw.lflag &= ~(… | termios.ISIG)` pyrepl needs to handle SIGSTOP itself, but before this patch would only signal its own process. Using `0` for the pid signals the process group instead. Manual test: When running the following from a shell `Ctrl-z` will not give you the shell's prompt, but the process is stuck, and needs to be signaled to continue using `kill -CONT $pid`: > python -c 'import os; os.system("python pyrepl/reader.py")' I have noticed this when using pdbpp with pytest, which was wrapped in a shell script, not using `exec python …`.
1 parent f1e5513 commit ca192a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyrepl/commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def do(self):
192192
r = self.reader
193193
p = r.pos
194194
r.console.finish()
195-
os.kill(os.getpid(), signal.SIGSTOP)
195+
os.kill(0, signal.SIGSTOP)
196196
## this should probably be done
197197
## in a handler for SIGCONT?
198198
r.console.prepare()

0 commit comments

Comments
 (0)