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

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

Closed
joeycozza opened this issue Feb 10, 2019 · 22 comments
Closed

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

joeycozza opened this issue Feb 10, 2019 · 22 comments
Labels
packaging/tooling question Further information is requested

Comments

@joeycozza
Copy link

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

@sharkdp
Copy link
Owner

sharkdp commented Feb 10, 2019

Thank you for the feedback.

There shouldn't be any shell completion files for bat 0.10 (see release notes). Maybe you just have to restart your terminal? If that doesn't help, could you please check if there is a _bat shell completion file left somewhere on your system?

@sharkdp sharkdp added question Further information is requested packaging/tooling labels Feb 10, 2019
@lavifb
Copy link
Contributor

lavifb commented Feb 10, 2019

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)

@dashmug
Copy link

dashmug commented Feb 11, 2019

I had this problem as well and @lavifb's comment above helped.

@joeycozza
Copy link
Author

Thanks @lavifb That worked for me.

@nshtg
Copy link

nshtg commented Mar 1, 2019

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

@garymh
Copy link

garymh commented Mar 2, 2019

Same, unfortunately 🙁 - deleted the .zcompdump file and just the line with _bat and neither worked.

@dashmug
Copy link

dashmug commented Mar 3, 2019

@nshtg @garymh You're supposed to restart your shell after deleting.

@lavifb
Copy link
Contributor

lavifb commented Mar 3, 2019

Make sure to restart your shell after deleting the files. Also make sure you have the latest version of bat.

If the problem persists could you tell us your OS, zsh, versions as above along with how you installed/upgraded bat? That way we can better help troubleshoot your issue.

@nshtg
Copy link

nshtg commented Mar 3, 2019

@lavifb
I did restart the shell ofc.

OS: MacOS Mojave
ZSH: zsh 5.7.1 (x86_64-apple-darwin18.2.0)

bat was installed using homebrew.

@garymh
Copy link

garymh commented Mar 3, 2019

Restarted the shell as well. I have the exact same setup as @nshtg actually. Maybe its homebrew related?

@lavifb
Copy link
Contributor

lavifb commented Mar 3, 2019

Well I also used homebrew and I would guess most Mac users also do too. My guess it has something to do with any zsh frameworks you might be using. Either it is setting a different file from ~/.zcompdump and ~/.zcompdump.cmp. You should check out your .zshrc or other config files for compinit -d <dumpfile>. You may also want to try reseting whatever zsh framework you are using if you are using one.

@kud
Copy link

kud commented Oct 9, 2019

#503 (comment) works! Cheers!

@sepehr
Copy link

sepehr commented Oct 13, 2019

Homebrew installation, no ~/.zcompdump entry, restarted shell, tried brew reinstall bat still problematic.

@sharkdp
Copy link
Owner

sharkdp commented Oct 13, 2019

What about this:

You may also need to delete the compiled version ~/.zcompdump.cmp

@sepehr
Copy link

sepehr commented Oct 13, 2019

Sorry, forgot to mention, yeah to no avail.

@sharkdp
Copy link
Owner

sharkdp commented Oct 13, 2019

Maybe this comment #503 (comment) by @lavifb can help.

You could try to search your home folder for files containing _bat. With rg or ag:

rg -uu '\b_bat\b' ~
ag -uu '\b_bat\b' ~

@sepehr
Copy link

sepehr commented Oct 13, 2019

"Maybe this comment #503 (comment) by @lavifb can help."

Read it, yet had no luck figuring out where to look 😥

"You could try to search your home"

I'm only finding these github notification emails and well, few mp3 files! :))

Appreciate your help anyway.

@sharkdp
Copy link
Owner

sharkdp commented Oct 13, 2019

"You could try to search your home"

I'm only finding these github notification emails and well, few mp3 files! :))

then maybe search root? that error message has to come from somewhere 😄

@sepehr
Copy link

sepehr commented Oct 13, 2019

Huh!

/usr/local/opt/zplug/.zcompdump

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

@luhmann
Copy link

luhmann commented Nov 1, 2019

For me it was

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

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

@Zeta611
Copy link
Contributor

Zeta611 commented Jul 11, 2022

It was ~/.zplug/zcompdump for me!

@vadim-cherepanov
Copy link

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!

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

No branches or pull requests