summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-03-30 19:28:21 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-03-30 19:49:05 +0900
commit31fd207ba232cf419f55cbfede8a90490bd25c5d (patch)
treea6b21d989c2444a89beef0b9bcc47c66c514f509 /man
parentba6d1b8772ce5e75ff999dcca21c0fadb689d7bf (diff)
downloadfzf-31fd207ba232cf419f55cbfede8a90490bd25c5d.tar.gz
Add 'r' flag (raw) for unquoted output
By default, placeholder expressions are automatically quoted to ensure they are safely passed as arguments to external programs. The r flag ({r}, {r1}, etc.) disables this behavior, outputting the evaluated value without quotes. For example, echo 'foo bar' | fzf --preview 'echo {} {r}' The preview command becomes: echo 'foo bar' foo bar Since `{r}` expands to unquoted "foo bar", 'foo' and 'bar' are passed as separate arguments. **Use with caution** Unquoted output can lead to broken commands. echo "let's go" | fzf --preview 'echo {r}' Close #4330
Diffstat (limited to 'man')
-rw-r--r--man/man1/fzf.16
1 files changed, 6 insertions, 0 deletions
diff --git a/man/man1/fzf.1 b/man/man1/fzf.1
index 4b2c5896..366cb3b2 100644
--- a/man/man1/fzf.1
+++ b/man/man1/fzf.1
@@ -768,6 +768,12 @@ e.g.
\fBfzf \-\-multi \-\-preview='head \-10 {+}'
git log \-\-oneline | fzf \-\-multi \-\-preview 'git show {+1}'\fR
+Each expression expands to a quoted string, so that it's safe to pass it as an
+argument to an external command. So you should not manually add quotes around
+the curly braces. But if you don't want this behavior, you can put
+\fBr\fR flag (raw) in the expression (e.g. \fB{r}\fR, \fB{r1}\fR, etc).
+Use it with caution as unquoted output can lead to broken commands.
+
When using a field index expression, leading and trailing whitespace is stripped
from the replacement string. To preserve the whitespace, use the \fBs\fR flag.