I have followed along with the tutorial to use ag instead of find for completions. However, I am getting an error when directly copy-pasting the _fzf_compgen_path() function from the docs.
ERR: Error fstat()ing stdin
Now, I know this error is from ag but I'm not quite sure why it is getting there. If I were to run the command directly: ag -g "" ./src (for example) I get a list of files. I've tried going through the completion.zsh file to understand what's going on but I'm lost. Isn't this (_fzf_compgen_path) the command that is called directly with the user input? Does anybody know why I would be seeing this error.
_fzf_compgen_path() {
ag -g "" "$1"
}
So you mean this doesn't work? It works for me.
Yea that exact line doesn't seem to work. I'm wondering if I have a plugin or something that is interfering. Not sure how to debug that, though.
Since I'm inexperienced, here are the last few lines of my ~/.zshrc:
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
_fzf_compgen_path() {
ag -g "" "$1"
}
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
Am I missing something else?
Interestingly, I'm also getting this using the Ctrl-t.
Hmm, is it still reproducible even when you trim down your .zshrc to contain only those lines?
Commented out everything but those lines and I'm getting the exact same error. Current versions:
Strange. I can't reproduce. I have zsh 5.2 on OS X.
ag --version? If you're running an old version, please upgrade ag and see if the problem persists.
I apologize. I just installed ag yesterday via apt. I didn't realize I was so many versions behind. I was on 0.19 but after installing from source I'm at 0.31.0 and things seem to be working now. Thank you for your time and for such an awesome tool!
Most helpful comment
I apologize. I just installed
agyesterday via apt. I didn't realize I was so many versions behind. I was on0.19but after installing from source I'm at0.31.0and things seem to be working now. Thank you for your time and for such an awesome tool!