agterm-win 0.45.5 · cookbook

FZF path picker

Pick a file or folder with fzf in an overlay, and the path is typed into the shell's prompt as an argument to what you were writing.

In agterm-win · Set it up in WSL · On Windows · The recipe

In agterm-win

An agterm-server session in an Ubuntu distribution, in a fresh agterm-win with the Nordic Blue Dark theme.

An fzf overlay over a half-typed sqlite3 command, filtered to inv
With sqlite3 -box half typed, the overlay searches the project's files.
The prompt now reads sqlite3 -box followed by the invoices.db path
Enter types the chosen path into the prompt, with no Return.

Set it up in WSL

In the distribution, from a copy of the recipe's folder.

$ sudo apt install zsh fzf fd-find
$ mkdir -p ~/bin
$ cp fzf-insert.zsh ~/bin/
$ chmod +x ~/bin/fzf-insert.zsh
$ ln -s "$(command -v fdfind)" ~/bin/fd
$ echo 'export AGT_FZF_ROOTS=$HOME/src' >> ~/.zshenv

Then, from a shell in an agterm session:

$ agtermctl session overlay open "zsh -lc '$HOME/bin/fzf-insert.zsh files <session-id>'" \
    --size-percent 80 --target <session-id>

On Windows

  • Ubuntu installs fd as fdfind. Link it as fd, as above.
  • agterm-win doesn't run keymap commands yet, so the overlay is opened with agtermctl from outside the session whose prompt you're typing in. The shots do the same.

The recipe, with how it works and its limits: cookbook/fzf-path-picker.

← SQLite browser · All recipes · Session snapshot →