mirror of
https://github.com/junegunn/fzf.git
synced 2025-07-26 01:31:59 -07:00
Add environment variables: FZF_{BORDER,PREVIEW}_LABEL (#3693)
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 commit is contained in:
11
CHANGELOG.md
11
CHANGELOG.md
@@ -3,6 +3,17 @@ CHANGELOG
|
||||
|
||||
0.49.0
|
||||
------
|
||||
- Added two environment variables exported to the child processes
|
||||
- `FZF_PREVIEW_LABEL`
|
||||
- `FZF_BORDER_LABEL`
|
||||
```sh
|
||||
# Use the current value of $FZF_PREVIEW_LABEL to determine which actions to perform
|
||||
git ls-files |
|
||||
fzf --header 'Press CTRL-P to change preview mode' \
|
||||
--bind='ctrl-p:transform:[[ $FZF_PREVIEW_LABEL =~ cat ]] \
|
||||
&& echo "change-preview(git log --color=always \{})+change-preview-label([[ log ]])" \
|
||||
|| echo "change-preview(bat --color=always \{})+change-preview-label([[ cat ]])"'
|
||||
```
|
||||
- Renamed `track` action to `track-current` to highlight the difference between the global tracking state set by `--track` and a one-off tracking action
|
||||
- `track` is still available as an alias
|
||||
- Added `untrack-current` and `toggle-track-current` actions
|
||||
|
Reference in New Issue
Block a user