Open wjrogers opened 4 years ago
Hi @wjrogers, if you set the --height
option, you can make fzf
smaller, which should at least erase fewer lines. Also, if you use the option --reverse
, it opens below the prompt, which may completely solve your issue.
@LuRsT I am using --reverse
, and passing --height
gives the message "--height option is currently not supported on Windows"
@wjrogers PR #1341 should fix this
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 --height
option, which is now supported on Windows.)
So this problem only happens when you don't use --height
option?
Correct. Using --height
works around it because it scrolls the terminal far enough for the fzf "window" to fit below the prompt.
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.
https://github.com/junegunn/fzf.vim/issues/1152#issuecomment-719696495
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 fzf --height=99%
.
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.