Also handle SIGPIPE as the Go runtime does funky things with this signal

This commit is contained in:
Kovid Goyal
2022-08-25 10:06:37 +05:30
parent 80c5ac891d
commit 6f8c884bb5
2 changed files with 17 additions and 1 deletions

View File

@@ -174,6 +174,10 @@ func (self *Loop) on_SIGINT() error {
return nil
}
func (self *Loop) on_SIGPIPE() error {
return nil
}
func (self *Loop) on_SIGWINCH() error {
self.screen_size.updated = false
if self.OnResize != nil {
@@ -287,7 +291,7 @@ func (self *Loop) Run() (err error) {
}()
sigchnl := make(chan os.Signal, 256)
reset_signals := notify_signals(sigchnl, SIGINT, SIGTERM, SIGTSTP, SIGHUP, SIGWINCH)
reset_signals := notify_signals(sigchnl, SIGINT, SIGTERM, SIGTSTP, SIGHUP, SIGWINCH, SIGPIPE)
defer reset_signals()
go func() {