Skip to content

Commit

Permalink
Sync screen clear
Browse files Browse the repository at this point in the history
  • Loading branch information
moncho committed Feb 27, 2016
1 parent e23ff4f commit 6808aa1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/screen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6808aa1

Please sign in to comment.