From 6aa2bddf6f72f2aba4bda92fad2d2527f04f414a Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Mon, 10 Feb 2025 16:58:29 -0500 Subject: [PATCH] feat(cellbuf): always go to the beginning of the next line on Close This is a behavioral change. Previously, the last line was cleared on Close. Now, the cursor is moved to the beginning of the next line. --- cellbuf/screen.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cellbuf/screen.go b/cellbuf/screen.go index 6feed938..dacf58ca 100644 --- a/cellbuf/screen.go +++ b/cellbuf/screen.go @@ -1358,8 +1358,8 @@ func (s *Screen) Close() (err error) { s.updatePen(nil) s.move(0, s.newbuf.Height()-1) - // TODO: Should we clear the last line? - // s.clearToEnd(nil, true) + // Scroll to the next line. + s.buf.WriteByte('\n') //nolint:errcheck if s.altScreenMode { s.buf.WriteString(ansi.ResetAltScreenSaveCursorMode)