Skip to content
Myr

Use a buffered channel for signal.Notify

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

authored by Christian Muehlhaeuser · committed by Christian Muehlhaeuser · parent 15e6233 · Browse files · 1 file+1 added−1 removed
This commit

State

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

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:commands_unix.go+1 added-1 removed
13 unmodified lines
14// this command could potentially run a lot. On that note, consider debouncing15// this function.16func OnResize(newMsgFunc func() Msg) Cmd {17 return func() Msg {18 sig := make(chan os.Signal)18 sig := make(chan os.Signal, 1)19 signal.Notify(sig, syscall.SIGWINCH)20 <-sig21 return newMsgFunc()22 }
1 unmodified line