fix: renderer: make sure to move the cursor to the top left corner after clearing the screen

This commit is contained in:
Ayman Bagabas 2025-02-03 09:19:50 -05:00
parent 96c871b934
commit 51536c04b0
No known key found for this signature in database
GPG key ID: C8D51D2157C919AC

View file

@ -152,7 +152,9 @@ func (s *cursedRenderer) resize(w, h int) {
// clearScreen implements renderer.
func (s *cursedRenderer) clearScreen() {
s.mu.Lock()
// Clear the screen and move the cursor to the top left corner.
s.scr.Clear()
io.WriteString(s.w, ansi.CursorHomePosition) //nolint:errcheck
repaint(s)
s.mu.Unlock()
}