Skip to content

Commit 819e2e8

Browse files
committed
fix(renderer): flush after moving cursor on close
1 parent 99c33bc commit 819e2e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cursed_renderer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ func (s *cursedRenderer) close() (err error) {
158158
// we're in alt screen mode or not to avoid leaving the cursor in the
159159
// middle in terminals that don't support alt screen mode.
160160
s.scr.MoveTo(0, s.cellbuf.Height()-1)
161+
_ = s.scr.Flush() // we need to flush to write the cursor movement
161162
if lv.AltScreen {
162163
enableAltScreen(s, false, true)
163164
} else {
@@ -627,6 +628,7 @@ func (s *cursedRenderer) clearScreen() {
627628
}
628629

629630
// enableAltScreen sets the alt screen mode.
631+
// Note that this writes to the buffer directly if write is true.
630632
func enableAltScreen(s *cursedRenderer, enable bool, write bool) {
631633
if enable {
632634
enterAltScreen(s, write)

0 commit comments

Comments
 (0)