Use a buffered channel for OS signals

This commit is contained in:
Christian Muehlhaeuser 2020-08-19 23:59:12 +02:00
parent e634ad5341
commit ed03a59e66
No known key found for this signature in database
GPG Key ID: 3CF9FA45CA1EBB7E
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ import (
// Argument output should be the file descriptor for the terminal; usually // Argument output should be the file descriptor for the terminal; usually
// os.Stdout. // os.Stdout.
func listenForResize(output *os.File, msgs chan Msg, errs chan error) { func listenForResize(output *os.File, msgs chan Msg, errs chan error) {
sig := make(chan os.Signal) sig := make(chan os.Signal, 1)
signal.Notify(sig, syscall.SIGWINCH) signal.Notify(sig, syscall.SIGWINCH)
for { for {
<-sig <-sig