Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] Reload keybinding to retrigger completion from already running fzf #316

Open
shadarim opened this issue Oct 4, 2022 · 1 comment
Open
Labels
question Further information is requested

Comments

@shadarim
Copy link

shadarim commented Oct 4, 2022

FZF has a reload action, which would execute a given command and load the results back in fzf. How do I replicate this with fzf-tab ?

Example use would be with:
kill -9 <tab>
and from within the completion hit Ctrl-R to reload the process list.

I can bind the reload as follows:
zstyle ':fzf-tab:complete:*' fzf-bindings 'ctrl-r:reload(ps -ef)'
and this does indeed reload the process list, but with some unwanted side effects:

  • list is not searchable anymore
  • color changes
  • selecting an entry is not outputting anything into the terminal anymore.

I guess this is because the newly generated list is not fed into fzf-tab as completions ?
Any hints on how to get the desired behavior ?

@shadarim shadarim added the question Further information is requested label Oct 4, 2022
@Aloxaf
Copy link
Owner

Aloxaf commented Oct 13, 2022

This is very hard.

You have to spawn a new zsh process to generate the new reuslt, and feed ${TMPPREFIX:-/tmp/zsh}-fzf-tab-$USER/completions.$$ to fzf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants