Fzf: Error fstat()ing stdin

Created on 12 May 2016  路  8Comments  路  Source: junegunn/fzf

  • Category

    • [ ] fzf binary

    • [ ] fzf-tmux script

    • [ ] Key bindings

    • [x] Completion

    • [ ] Vim

    • [ ] Neovim

    • [ ] Etc.

  • OS

    • [x] Linux

    • [ ] Mac OS X

    • [ ] Windows

    • [ ] Etc.

  • Shell

    • [ ] bash

    • [x] zsh

    • [ ] fish

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.

Most helpful comment

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!

All 8 comments

_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:

  • Ubuntu 14.04
  • zsh 5.0.2 (x86_64-pc-linux-gnu)
  • tmux 2.2

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

firedev picture firedev  路  3Comments

jan-warchol picture jan-warchol  路  3Comments

ahmedelgabri picture ahmedelgabri  路  3Comments

sandric picture sandric  路  3Comments

erusev picture erusev  路  3Comments