-
Notifications
You must be signed in to change notification settings - Fork 622
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
zsh:12: command not found: __tig_main #940
Comments
I have/had the same problem. I installed the completion file from this repository to ~/.completion but it did not work. reading in the logs of |
tried the updated version of completion and it didn't help - but likely not because of that PR itself, since the issue seems to be coming from something else. as @Garonenur mentions, if I remove the i suspect the reason has to do with the bottom of
the |
our workaround is not working for me anymore, I removed the _git file that came with ubuntu (WSL) and I have git and tig compiled from source, the respective completion files are in my
the second time I tap tab. |
this part of the code:
breaks, because |
I don't understand zsh completion enough... after |
On 12 March 2020 12:53:39 CET, Dirk Willrodt ***@***.***> wrote:
this part of the code:
```
while [ $c -lt $cword ]; do
i="${words[c]}"
case "$i" in
--) command="log"; break;;
-*) ;;
*) command="$i"; break ;;
esac
c=$((++c))
done
```
breaks, because ```cword``` is apparently not defined. and ``` a -lt
``` is no valid syntax.
The `cword` variable is set up by the git completion wrapper, which wraps the `_tig` function (see setup at the end of the file). So yes, the git completion needs to be available first, but sadly I also don't know anything about how zsh completion works on the inside and how to force loading the git completion first…
|
Try the following patch on /usr/local/share/zsh/site-functions/_tig (or wherever you have it installed): diff --git a/contrib/tig-completion.zsh b/contrib/tig-completion.zsh
index 585df16..0e5ea12 100644
--- a/contrib/tig-completion.zsh
+++ b/contrib/tig-completion.zsh
@@ -14,6 +14,10 @@
_tig () {
local e
+ e=$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
+ if [ -f $e ]; then
+ GIT_SOURCING_ZSH_COMPLETION=y . $e
+ fi
e=$(dirname ${funcsourcetrace[1]%:*})/tig-completion.bash
if [ -f $e ]; then
. $e |
seems not working either T.T |
Indeed. It did work when I sent it but after a subsequent git upgrade it stopped working. It looks like our zsh completion would need a complete revamp as was done for bash. Unfortunately I'm not using zsh myself so unless some zsh user is volunteering to contribute it our best option will be to remove it and to rely on the basic one provided by zsh. |
It seems oh my zsh (god bless this tool and its the community 😀) interferes with zsh completion in rm /usr/local/share/zsh/site-functions/_tig
rm /usr/local/share/zsh/site-functions/tig-completion.bash This works at least for me. |
I got this error when git wasn't installed by brew. Doing "brew install git" fixed it. |
There are some Nixpkgs specific issues that we could fix but due to changes in Git it currently isn't possible to source git-completion.bash from ZSH (at least not how tig-completion.bash expects it). Upstream issue: jonas/tig#940 For the meantime it seems best to simply not install it anymore so that the fallback implementation from ZSH can be used (more inaccurate as the git-log completion is reused but it is helpful to complete remotes, branches, tags, etc. and doesn't emit an error to the console).
There are some Nixpkgs specific issues that we could fix but due to changes in Git it currently isn't possible to source git-completion.bash from ZSH (at least not how tig-completion.bash expects it). Upstream issue: jonas/tig#940 For the meantime it seems best to simply not install it anymore so that the fallback implementation from ZSH can be used (more inaccurate as the git-log completion is reused but it is helpful to complete remotes, branches, tags, etc. and doesn't emit an error to the console).
@Garonenur The idea is that However, in Zsh I sent a pull request with those changes, which includes renaming the main completion function. |
It happened When I input
tig
and then tap ‘tab’ button.zsh:12: command not found: __tig_main
Some info:
The text was updated successfully, but these errors were encountered: