From 6808aa12bed24f846a6e1db2b30bd4ce4d4cb540 Mon Sep 17 00:00:00 2001 From: moncho Date: Sat, 27 Feb 2016 19:49:25 +0100 Subject: [PATCH] Sync screen clear --- ui/screen.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/screen.go b/ui/screen.go index c75410d5..f4eca452 100644 --- a/ui/screen.go +++ b/ui/screen.go @@ -61,14 +61,18 @@ func (screen *Screen) Resize() *Screen { //Clear makes the entire screen blank using default background color. func (screen *Screen) Clear() *Screen { + screen.termboxMutex.Lock() + defer screen.termboxMutex.Unlock() termbox.Clear(termbox.ColorDefault, termbox.ColorDefault) screen.cleared = true - screen.Flush() + termbox.Flush() return screen } // Sync forces a complete resync between the termbox and a terminal. func (screen *Screen) Sync() *Screen { + screen.termboxMutex.Lock() + defer screen.termboxMutex.Unlock() termbox.Sync() return screen }