ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
46.69k stars 19.67k forks source link

zsh completion not working #29080

Open Xeonacid opened 4 months ago

Xeonacid commented 4 months ago

System information

Geth version: 1.13.13-stable OS & Version: Linux Ubuntu 22.04

Expected behaviour

Type geth then press Tab, a command completion is listed.

Actual behaviour

Files in cwd is listed, acting same as without a completion.

But if run source /usr/share/zsh/vendor-completions/_geth manually, it works fine like a charm.

Steps to reproduce the behaviour

sudo add-apt-repository ppa:ethereum/ethereum
sudo apt install geth

In zsh, type geth then press Tab, files in cwd is listed.

Other command completions in /usr/share/zsh/vendor-completions work fine.

Run source /usr/share/zsh/vendor-completions/_geth and try again, completion works fine.

cc @willianpaixao

hashworks commented 4 months ago

Note: This only affects the ZSH completion, the BASH completion is sourced automatically as one would expect.

willianpaixao commented 4 months ago

Thanks for reporting, @Xeonacid. At the moment of writing I'm not in my computer but will test it later. That said, it looks like Zsh is not automatically sourcing that file, just stating the obvious. Which makes me think it's a Zsh issue and not Geth.

Xeonacid commented 4 months ago

That said, it looks like Zsh is not automatically sourcing that file, just stating the obvious. Which makes me think it's a Zsh issue and not Geth.

But any other file in the same folder (/usr/share/zsh/vendor-completions) is automatically sourced and completion works fine. I'm not a zsh expert and have no idea about what's wrong. :(