fix: add missing signal.Stop in suspendProcess to prevent signal channel leak (Closes #1673) (#1674)

Each Ctrl+Z suspend call registered a SIGCONT channel via signal.Notify
but never called signal.Stop after receiving the signal. This caused a
signal channel leak on every suspend/resume cycle.

All other signal handlers in the codebase (handleSignals in tea.go and
listenForResize in signals_unix.go) correctly defer signal.Stop.

Signed-off-by: Cocoon-Break <54054995+kuishou68@users.noreply.github.com>
This commit is contained in:
Cocoon-Break 2026-04-13 20:46:47 +08:00 committed by GitHub
parent 05df5aecf8
commit 729f05c315
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,6 +40,7 @@ const suspendSupported = true
func suspendProcess() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGCONT)
defer signal.Stop(c)
_ = syscall.Kill(0, syscall.SIGTSTP)
// blocks until a CONT happens...
<-c