Open unphased opened 4 years ago
You can move your cursor around with ANSI escape sequences like so:
# Enter => delete it
# CTRL-C => leave it
fzf --no-clear --height 20 > /dev/null && echo -e "\x1b[J\x1b[A" || echo -e "\x1b[19B"
But I'm not sure if it's possible to achieve this behavior just by setting FZF_CTRL_R_OPTS.
man fzf
)Info
Problem / Steps to reproduce
I'd like to be able to configure fzf when I use it with the ctrl+R binding (in zsh) to leave the buffer present on screen if I cancel the search. Half of the time I use history recall with fzf to re-run something (in this case I want the buffer to clear), but the other half of the time I want to see what I ran before and cancel it and run it modified. It would be nice to have it leave the buffer as-is so I can refer to the output as I construct the new command.
I have tested with
echo 'abc\ndef' | fzf --no-clear
that this works as expected, but adding--no-clear
to the (pretty complex)FZF_DEFAULT_OPTS=
infzf-history-widget
in~/.fzf/shell/key-bindings.zsh
had no effect. It seems like either it conflicts or is negated by some of the other configuration here?I was hoping I could at least make it leave the buffer up no matter what, but I couldn't even get that working.