bat: Upgrade to 0.10.0 issue: "(eval):1: command not found: _bat"

After doing a brew upgrade bat to get version 0.10.0, when I try to tab complete a filename, I get the error output “(eval):1: command not found: _bat” (and it prints 3 times)

Using: Mac OSX iTerm2 3.2.7 zsh 5.3 (x86_64-apple-darwin18.0) bat 0.10.0

I’m not sure how to debug this further, any input or guidance would be appreciated

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (8 by maintainers)

Most upvoted comments

I had the same problem. I believe the issue is that the completion file is cached by zsh but then it cannot find it. Try checking in ~/.zcompdump and delete the line with _bat. That worked for me. (You may also need to delete the compiled version ~/.zcompdump.cmp)

Huh!

/usr/local/opt/zplug/.zcompdump

Guess because zplug was homebrew-installed. Really appreciate the help.

I’ve been having the same problem on Debian Linux for years, but with nano, when pressing Tab after typing nano with or without additional parameters would cause familiar:

(eval):1: command not found: _nano

Finally, I found the answer here for a different command! Decided to write it down, because otherwise searching on Google for “command not found: _nano” is absolutely useless – maybe it will pick up this thread for “nano” as well.

Also, for reference, in general, the answer would be to search for all “zcompdump” files you may have anywhere, depending on your installation. So, do something like this:

find / -regex '.*/\.?zcompdump$' 2>/dev/null 

Then check everything it returns, and try to delete or (safe!) rename them and start a new shell to check if the problem is solved. In my case, this results in

/home/user/.zplug/zcompdump
/home/user/.zcompdump

and the offensive one was ~/.zplug/zcompdump. Special thanks to @lavifb and @sepehr!

For me it was

# not a dotfile
/usr/local/opt/zplug/zcompdump

that had the offending entry. Thanks for all of your help!

For me the bug is still present even after purging the .zcompdump files.