diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-09-29 22:36:44 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-10-09 00:17:00 +0900 |
| commit | 8f0c91545d308e534284b19edf61cbdb1ebbb315 (patch) | |
| tree | e670530b324b8d9bfdde7ba5dc2c625cfbed8261 /CHANGELOG.md | |
| parent | 0eefcf348e7e56c6ee0f888384d63281e6678a7d (diff) | |
| download | fzf-8f0c91545d308e534284b19edf61cbdb1ebbb315.tar.gz | |
Add $FZF_RAW for conditional actions
Diffstat (limited to 'CHANGELOG.md')
| -rw-r--r-- | CHANGELOG.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ec86bf6..334b7f64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,22 @@ fzf --raw --color hidden:red:strikethrough fzf --raw --color hidden:regular:red:strikethrough ``` +#### Conditional actions for raw mode + +You may want to perform different actions depending on whether the current item +is a match or not. For that, fzf now exports `$FZF_RAW` environment variable. + +It's: + +- Undefined if raw mode is disabled +- `1` if the current item is a match +- `0` otherwise + +```sh +# Do not allow selecting non-matching items +fzf --raw --bind 'enter:transform:[[ ${FZF_RAW-1} = 1 ]] && echo accept || echo bell' +``` + #### Leveraging raw mode in shell integration The `CTRL-R` binding (command history) now lets you toggle raw mode with |
