diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fea973..cd9a173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ CHANGELOG orthogonally controlling "exactness" of search - Fixed not to display non-printable characters - Added `double-click` for `--bind` option +- More robust handling of SIGWINCH 0.10.8 ------ diff --git a/src/terminal.go b/src/terminal.go index 4f8341d..ed79728 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -713,21 +713,6 @@ func executeCommand(template string, current string) { func (t *Terminal) Loop() { <-t.startChan { // Late initialization - t.mutex.Lock() - t.initFunc() - t.calculateMargins() - t.printPrompt() - t.placeCursor() - C.Refresh() - t.printInfo() - t.printHeader() - t.mutex.Unlock() - go func() { - timer := time.NewTimer(initialDelay) - <-timer.C - t.reqBox.Set(reqRefresh, nil) - }() - intChan := make(chan os.Signal, 1) signal.Notify(intChan, os.Interrupt, os.Kill) go func() { @@ -744,6 +729,21 @@ func (t *Terminal) Loop() { } }() + t.mutex.Lock() + t.initFunc() + t.calculateMargins() + t.printPrompt() + t.placeCursor() + C.Refresh() + t.printInfo() + t.printHeader() + t.mutex.Unlock() + go func() { + timer := time.NewTimer(initialDelay) + <-timer.C + t.reqBox.Set(reqRefresh, nil) + }() + // Keep the spinner spinning go func() { for {