-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
Checklist
- I have read through the manual page (
man fzf) - I have searched through the existing issues
- For bug reports, I have checked if the bug is reproducible in the latest version of fzf
Output of fzf --version
0.67.0 (2ab923f)
OS
- Linux
- macOS
- Windows
- Etc.
Shell
- bash
- zsh
- fish
Problem / Steps to reproduce
I am working on an fzf-based shell snippet manager, now working on the batcat integration.
I was looking for a way to output color codes to the preview command when using --ansi flag.
# this command colors the filtering list, but not the output preview
bat --decorations=never --color=always ~/snippets.sh ~/paths.path | fzf --ansi --preview="echo {}"
# this command shows color codes in the filtering list, but shows the correctly colored preview output
bat --decorations=never --color=always ~/snippets.sh ~/paths.path | fzf --preview="echo {}"
Of course I could use another preview command, e.g. echo {} | bat -l bash, but this way I am forced to specify a language. The nice thing of using just a plain echo {} is that bat can just color its output based on file extension, e.g. .sh, .path.
Could we add a --ansi-preview option (or something like that) for this purpose?
Metadata
Metadata
Assignees
Labels
No labels