feat(fzf): add preview, dirs, and image support to @@ inline picker #110

Merged
rootiest merged 1 commits from enhance-fzf-inline-picker-preview into main 2026-08-21 04:47:17 +00:00
Owner

Summary

  • @@ (__fzf_inline_picker) now lists both files and directories, via the same fd-based approach _fzf_search_directory already uses, instead of files-only.
  • Adds a preview pane, colored border/label/header, and a ctrl-/ toggle, matching the visual polish of the logs picker. Preview delegates to the existing _fzf_preview_file helper (bat-highlighted text, ls for directories).
  • _fzf_preview_file now detects images via file --mime-type and renders them through a new _fzf_preview_image helper, with a fallback chain: kitty graphics protocol (kitten icat, gated on kitty/WezTerm/Ghostty detection) → chafaviutimg → plain file-info line. Since _fzf_preview_file is shared, the Ctrl+F directory search and git-status pickers pick up image previews too.

Manual Verification Checklist

  • Press @ twice at the prompt in a directory with both files and subdirectories; confirm both show up in the list
  • Select a text file and confirm the preview pane shows bat syntax highlighting
  • Select a directory and confirm the preview pane lists its contents
  • Select an image file in a kitty/WezTerm/Ghostty session and confirm it renders inline via the graphics protocol
  • Press ctrl-/ to toggle the preview pane on/off
  • Press Esc with no selection and confirm @@ is left in place on the command line
## Summary - `@@` (`__fzf_inline_picker`) now lists both files **and** directories, via the same `fd`-based approach `_fzf_search_directory` already uses, instead of files-only. - Adds a preview pane, colored border/label/header, and a `ctrl-/` toggle, matching the visual polish of the `logs` picker. Preview delegates to the existing `_fzf_preview_file` helper (bat-highlighted text, `ls` for directories). - `_fzf_preview_file` now detects images via `file --mime-type` and renders them through a new `_fzf_preview_image` helper, with a fallback chain: kitty graphics protocol (`kitten icat`, gated on kitty/WezTerm/Ghostty detection) → `chafa` → `viu` → `timg` → plain `file`-info line. Since `_fzf_preview_file` is shared, the Ctrl+F directory search and git-status pickers pick up image previews too. ## Manual Verification Checklist - [x] Press `@` twice at the prompt in a directory with both files and subdirectories; confirm both show up in the list - [x] Select a text file and confirm the preview pane shows bat syntax highlighting - [x] Select a directory and confirm the preview pane lists its contents - [x] Select an image file in a kitty/WezTerm/Ghostty session and confirm it renders inline via the graphics protocol - [x] Press `ctrl-/` to toggle the preview pane on/off - [x] Press `Esc` with no selection and confirm `@@` is left in place on the command line
rootiest added 1 commit 2026-08-21 04:46:47 +00:00
The @@ picker only listed files with no preview. It now lists both
files and directories via fd (matching _fzf_search_directory), and
shows a bat-highlighted or image-rendered preview through
_fzf_preview_file. Image previews use a kitty-graphics-protocol,
chafa, viu, timg fallback chain via the new _fzf_preview_image
helper, benefiting the Ctrl+F directory search and git-status
pickers as well since they share the same preview helper.
rootiest merged commit a5cc8cbd36 into main 2026-08-21 04:47:17 +00:00
rootiest deleted branch enhance-fzf-inline-picker-preview 2026-08-21 04:47:17 +00:00
Sign in to join this conversation.