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

unable to restart fzf when file changes using entr #3510

Open
5 of 10 tasks
lgersman opened this issue Nov 17, 2023 · 0 comments
Open
5 of 10 tasks

unable to restart fzf when file changes using entr #3510

lgersman opened this issue Nov 17, 2023 · 0 comments
Labels

Comments

@lgersman
Copy link

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

I often want to restart fzf (or a script executing fzf) when script files change for quicker development turnaround cycles. In other cases (using make and friends) i use entr as the "watch" tool.

I do not want to reload fzf data but the whole fzf (or even a script executing fzf)

But I am unable to restart fzf using entr for some reason.

Not working example:

find . -type f | entr -a -n sh -c 'find . -type f | fzf'

I tried a lot of quirky variants for watch/reload but they all seems to me too complicated.

(quirky) working example:

touch /tmp/fzf_pid
while [[ -f /tmp/fzf_pid ]]
do 
  find . -type f | entr -dd -c -p -n -z curl localhost:6266 -d 'execute:kill $(cat /tmp/fzf_pid)' & 
  fzf --listen 6266 --bind 'start:execute-silent(echo $PPID > /tmp/fzf_pid)' --bind 'esc:cancel+execute(rm /tmp/fzf_pid)'

  [[ "$?" -eq 0 ]] && exit
done

I am sure there is a much more easier option to watch files and reload fzf on changes.

Any help is welcome :-)

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

No branches or pull requests

2 participants