Skip to content

Commit 729f05c

Browse files
authored
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>
1 parent 05df5ae commit 729f05c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tty_unix.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const suspendSupported = true
4040
func suspendProcess() {
4141
c := make(chan os.Signal, 1)
4242
signal.Notify(c, syscall.SIGCONT)
43+
defer signal.Stop(c)
4344
_ = syscall.Kill(0, syscall.SIGTSTP)
4445
// blocks until a CONT happens...
4546
<-c

0 commit comments

Comments
 (0)