Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by Cocoon-Break · committed by GitHub · parent 05df5ae · Browse files · 1 file+1 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Cocoon-Break <54054995+kuishou68@users.noreply.github.com>

Diff stats

1 file+1 added−0 removed

  • other:+1 added−0 removed

1 file+1 added−0 removed

modified:tty_unix.go+1 added
38 unmodified lines
39// Send SIGTSTP to the entire process group.40func suspendProcess() {41 c := make(chan os.Signal, 1)42 signal.Notify(c, syscall.SIGCONT)43 defer signal.Stop(c)44 _ = syscall.Kill(0, syscall.SIGTSTP)45 // blocks until a CONT happens...46 <-c47}