And simplify the argument escaping code. Fix#3764.
This may breaks some existing use cases, but the mode causes too much
trouble when escaping arguments and it makes some things not possible.
# Now you can pass special characters to rg process without any escaping problems: &|<>()@^%!
fzf --ansi --disabled --bind "change:reload:rg --column --line-number --no-heading --color=always --smart-case -- {q}"
# No sudden expansion of the arguments on '!'
fzf --disabled --preview "echo {q} {n} {}" --query "&|<>()@^%!" --prompt "&|<>()@^%!"
Sets $FZF_CLICK_HEADER_LINE and $FZF_CLICK_HEADER_COLUMN env vars with
coordinates of the last click inside and relative to the header and
fires click-header event.
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
When the search for the initial query doesn't finish immediately
fzf would trigger an invalid 'result' event for an empty query.
seq 100 | fzf --query 99 --bind result:accept --sync
# Prints 99
seq 1000000 | fzf --query 99 --bind result:accept --sync
# Should print 99, but fzf would print 1
The environment variable get the value of the preview label, even if it
has been updated with an action. It can be useful to track the label of
the preview and be able to switch between previews using only one
binding.
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
This simplifies the distribution, and the users are less likely to have
problems caused by using incompatible scripts and binaries.
# Set up fzf key bindings and fuzzy completion
eval "$(fzf --bash)"
# Set up fzf key bindings and fuzzy completion
eval "$(fzf --zsh)"
# Set up fzf key bindings
fzf --fish | source
For those who prefer to manage default options in a file.
If the file is not found, fzf will exit with an error.
We're not setting a default value for it because:
1. it's hard to find a default value that can be universally agreed upon
2. to avoid fzf having to check for the existence of the file even when it's not used
Because fzf processes HTTP GET requests in the main event loop,
accessing the endpoint from within execute/transform actions would
result in a deadlock and hang fzf indefinitely. This commit sets
a 2 second timeout to avoid the deadlock.
So that it can determine if it should subtract 1 from $FZF_PREVIEW_LINES
to avoid scrolling issue of Sixel image that touches the bottom of the
screen.
Progress:
* Sixel image can now be displayed with other text, and is scrollable
* If an image can't be displayed entirely due to the scroll offset, fzf
will render a wireframe to indicate that an image should be displayed
* Renamed $FZF_PREVIEW_{WIDTH,HEIGHT} to $FZF_PREVIEW_PIXEL_{WIDTH,HEIGHT}
for clarity
* Added bin/fzf-preview.sh script to demonstrate how to display an image
using Kitty or Sixel protocol
An example:
ls *.jpg | fzf --preview='seq $((FZF_PREVIEW_LINES*9/10)); fzf-preview.sh {}; seq 100'
A known issue:
* If you reduce the size of the preview window, the image may extend
beyond the preview window