-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fzf erases scrollback buffer on Windows #1766
Comments
Hi @wjrogers, if you set the |
@LuRsT I am using |
I just tested in 0.24.1, and this bug is not fixed. Will you please re-open? (@KindDragon's comment was referring to the |
So this problem only happens when you don't use |
Correct. Using |
Can you test if this binary helps in your case? I don't have a Windows environment to test it now. It just makes fzf use the new renderer instead of tcell library when it's available. diff --git a/src/terminal.go b/src/terminal.go
index 778665a..8697d21 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -408,11 +408,11 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
var renderer tui.Renderer
fullscreen := opts.Height.size == 0 || opts.Height.percent && opts.Height.size == 100
if fullscreen {
- if tui.HasFullscreenRenderer() {
- renderer = tui.NewFullscreenRenderer(opts.Theme, opts.Black, opts.Mouse)
- } else {
+ if tui.IsLightRendererSupported() {
renderer = tui.NewLightRenderer(opts.Theme, opts.Black, opts.Mouse, opts.Tabstop, opts.ClearOnExit,
true, func(h int) int { return h })
+ } else {
+ renderer = tui.NewFullscreenRenderer(opts.Theme, opts.Black, opts.Mouse)
}
} else {
maxHeightFunc := func(termHeight int) int { |
Yes, that binary completely fixes the bug! Tested both Command Prompt and Windows Terminal. Windows 20H2 (19042.610). |
Thanks for the confirmation. Patch pushed to master. Please report any issues you run into. /cc @kelleyma49 |
I had to revert the commit as it doesn't work correctly inside Vim. |
The tcell library used in FullscreenRenderer is clipping the console's buffer to the size of console's window during initialization (and few more occasions). There was an effort to preserve the buffer and restore it on exit gdamore/tcell#288. You could also switch to LightRenderer with |
man fzf
)Info
Problem / Steps to reproduce
dir
ortree
fzf
Interestingly, in the new Windows Terminal, the problem is less severe: only the visible lines in the terminal are erased when running
fzf
. Anything in the scrollback buffer is still there afterward.The text was updated successfully, but these errors were encountered: