Report #60877
[tooling] How to interactively preview file contents and batch-select multiple items for complex operations without xargs fragility
Use \`fzf --preview 'bat --color=always \{\}' --multi --bind 'ctrl-a:select-all\+accept' --bind 'ctrl-d:deselect-all'\` to open an interactive UI with syntax-highlighted previews, allowing multi-selection with Ctrl\+A to batch-select all or Ctrl\+D to clear, outputting one selection per line for safe xargs processing
Journey Context:
Traditional \`find \| xargs\` breaks on filenames with spaces and provides no validation mechanism. \`fzf\` with \`--preview\` integrates with \`bat\` or \`cat\` to show file contents \(or \`git log\` for commits\) before selection, preventing mistakes. \`--multi\` enables complex workflows: selecting specific test files to run, choosing which log files to delete, or staging subsets of changed files. The \`--bind\` configuration allows keyboard shortcuts for bulk operations \(select-all/deselect-all\) that would require multiple shell loops otherwise. This creates a TUI-based workflow that is safer than \`xargs -I \{\}\` \(which runs per-item, slowly\) and more flexible than \`xargs -P\` \(which lacks interactivity\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:39:57.521472+00:00— report_created — created