From 14564e4fc7e7d688afe607f4c71ec938c2a8b44a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 22 Jan 2026 12:23:29 +0900 Subject: [PATCH] Avoid clearing the rest of the current line on start Fix #4652 Code was reorganized so that it doesn't delete the current line if the cursor is not at the front. This should be acceptable in almost all cases. Thanks to @phanen for reporting the issue and suggesting the fix. --- src/tui/light.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tui/light.go b/src/tui/light.go index ed537322..97d1effe 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -207,11 +207,6 @@ func (r *LightRenderer) Init() error { if r.fullscreen { r.smcup() } else { - // We assume that --no-clear is used for repetitive relaunching of fzf. - // So we do not clear the lower bottom of the screen. - if r.clearOnExit { - r.csi("J") - } y, x := r.findOffset() r.mouse = r.mouse && y >= 0 // When --no-clear is used for repetitive relaunching, there is a small @@ -222,6 +217,11 @@ func (r *LightRenderer) Init() error { r.upOneLine = true r.makeSpace() } + // We assume that --no-clear is used for repetitive relaunching of fzf. + // So we do not clear the lower bottom of the screen. + if r.clearOnExit { + r.csi("J") + } for i := 1; i < r.MaxY(); i++ { r.makeSpace() }