I upgraded to the lastest fzf version 0.16.1 and found the default height changed in normal bash shell (not inside tmux).
Can I change it back to normal full terminal(screen) mode?
Add --no-height --no-reverse to your $FZF_DEFAULT_OPTS. Or you can add it to each per-binding configuration, such as $FZF_CTRL_T_OPTS.
Updated the wiki page with the info:
https://github.com/junegunn/fzf/wiki/Configuring-shell-key-bindings#changing-the-layout
@junegunn Sorry, I don't quite understand this decision. You recently hardcoded --height into ctrl-r, effectively forcing users who have never used it to add another option --no-height to cancel it. Why didn't you just add --height to your own FZF_DEFAULT_OPTS? Also, what's the point of --no-height if you can simply omit --height? (except when you can't where --height is hardcoded). This war of options got so complicated and frustrating...
Another confusion is that --height seems to erase screen content. This is very confusing when cursor is at the bottom of the screen. Here I demonstrated it with and without --height: https://asciinema.org/a/bmfcztbpzod891qindyfppz3e. Is this a bug? Do you want me to create an issue on that?
@balta2ar Your argument assumes that full screen mode is the better default, but that is subjective. There are users including myself (see the links below), who prefer this new --height layout over the obtrusive full screen layout or tmux layout that causes undesirable side effects such as unzooming a zoomed pane. And I'm choosing what I think is the best as the default, just like I decided to make the new matching algorithm as the default when it was introduced a few months ago. You may not agree with the decision, but on the flip side, there can be users who would wonder why full screen mode is still the default layout for fzf when --height is available. I'm sorry to hear that you don't like the new default, but I like it a lot (if I don't like it, why would I spend my time and energy implementing it?), and any decision I make can't satisfy every different taste at the same time.
Another confusion is that --height seems to erase screen content.
fzf prints new lines to make space for the finder. Screen content is not erased but is put in the scrollback buffer. I don't know if it's possible to "un-scroll" the screen.
@junegunn Sorry if my previous comment sounded like a rant or a complaint. I didn't mean to. I understand that you spend a lot of your own time on this for free and you don't own anything to anybody.
To be more constructive, let me ask it this way. What if instead of hard coding, you put --height into CTRL_R_OPTS by default (if it's not set by a user)? In this case 1. height would be default as you like 2. I could override CTRL_R_OPTS to cancel height effect. yes I can do it now using no-height, but 3. You would not need no-height option anymore: it potentially saves your time maintaining the code — less options, the better. What do you think?
As for un-scrolling, I think it's reasonable to expect that fzf without height (fullscreen) and fzf with height=100% behave exactly the same. As of now their effect is different. I'm not using height so it's not bothering me, but it still looks inconsistent and other users may ask the same question.
EDIT: Judging by your last comment at gitter you didn't know they have different behavior. Please consider this "unscrolling" feature before throwing off old renderer.
Once we're confident with this new renderer, I'll completely replace ncurses renderer with it (basically --no-height becomes --height 100%)
EDIT2: Apparently, there is a reason to have --no-height, and the reason is that it uses a different renderer. This makes suggestion in my second paragraph pretty much useless.
@balta2ar
yes I can do it now using no-height, but 3. You would not need no-height option anymore
No, I don't think it's a good idea. Just wanted to change the background color, export FZF_CTRL_R_OPTS='--color "bg:#123123"' and you have fzf running in full screen mode? It's a surprising change of behavior that you didn't ask for.
Apparently, there is a reason to have --no-height, and the reason is that it uses a different renderer.
Correct. But it's a leaky abstraction, things should be cleared up in the future.
I have plans for improving --height 100% or something like --height 999999 using alternate screen just like ncurses, so no scrolling. The obvious next step is to remove ncurses renderer completely; true-color support, easier build steps, less compatibility headaches.
@junegunn
Thanks, I try your suggestions, it works.
Most helpful comment
Add
--no-height --no-reverseto your$FZF_DEFAULT_OPTS. Or you can add it to each per-binding configuration, such as$FZF_CTRL_T_OPTS.