term.widgets.file_chooser

term.widgets

file_chooser(opts) -> path

Display an interactive file chooser dialog with fuzzy search

Opens a bordered dialog with a search field for browsing and selecting files. When the search field is empty, shows a flat directory listing sorted by recency. When text is entered, recursively scans subdirectories and ranks results by fuzzy match score and recency.

Set opts.multiple_choice = true for multi-file selection. Selected files are pinned at the top of the dialog. Use CTRL+ENTER to confirm selection, ESC to clear search (or exit if search is already empty).

Options: title, start_dir, show_hidden, multiple_choice, max_depth (default 5), max_scan_results (default 1000), rss. Returns full path string, array of paths, or nil on cancel.