-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Incorrect file location in suggested zsh autocompletion setup command on Manjaro #2204
Comments
Thanks @tarlacac for the report. The fact that your |
Thanks for the quick response @marckhouzam! You're right that this is an easy fix on my end; I actually just ran the suggested command with After hours of digging through my file system, Manjaro forums, and the zsh manual, I don't think this is a misconfiguration on my part anymore, unfortunately. This seems to be a Manjaro issue, or deeper, since I just downloaded the latest minimal Manjaro Gnome ISO (24.1.2) and the fpath issue I described was present when I booted into that as well. It has been an issue for a few major releases of Manjaro, at least, since it is also present in my older 22.0.4 ISO.
I do have to give a little push-back here on wording. The way I read it, the cobra zsh completion help message doesn't mention to put the completion script under |
Apologies, I realized a place I haven't looked for a solution yet: reading through the compile instructions and source code for zsh. This brought me to their changelog, where I found the default fpath info I've been looking for! I have learned a lot in the last few days through researching this... Back in 2014 with zsh 5.0.7, it appears that the default fpath was changed so Since zsh explicitly documents that |
Apologies in advance, I am not a Go developer so I don't have a great understanding of the implementation details (this is my first time actually looking at code in the language!).
Did you look for related issues?
I did not find anything specifically discussing this, but I found another issue recommending the command that is not working for me (#1165, but the link to the instructions they followed does not exist anymore), a similar issue on an M1 mac (#1589), an issue discussing incorrect zsh configuration inhibiting their completions (#1534), an older issue about a different command for zsh completion (#1529), and a few others that were less relevant about zsh completions.
Describe the bug
The zsh completion generation help message does not work to load completions for every new session on Manjaro Linux (and I'm guessing Arch Linux, too). This appears to be because
${fpath[1]}
defaults to/usr/local/share/zsh/site-functions
, but that directory does not exist. Instead,/usr/share/zsh/site-functions
is being used, which appears to be the default location from inspecting the PKGBUILD files forextra/zsh
andextra/zsh-completions
, and is the value of${fpath[2]}
.To Reproduce
Steps to reproduce the behavior:
<program> completion zsh > "${fpath[1]}/_<program>"
/usr/local/share/zsh
does not exist:% ls /usr/local/share/zsh ls: cannot access '/usr/local/share/zsh': No such file or directory
/usr/share/zsh
exists:Expected behavior
My zsh site-functions directory is
/usr/share/zsh/site-functions
, so I would expect the recommended command to use that directory. Alternatively, it would be nice to have a note warning that the location might be/usr/share/zsh/site-functions
instead of/usr/local/share/zsh/site-functions
.Desktop (please complete the following information):
uname -a
:Linux <hostname> 6.6.54-2-MANJARO #1 SMP PREEMPT_DYNAMIC Tue Oct 8 03:11:08 UTC 2024 x86_64 GNU/Linux
zsh --version
:zsh 5.9 (x86_64-pc-linux-gnu)
Additional context
I am coming from fan2go, where I submitted an issue and was told this particular help command output was generated by cobra. I do know that they are using the latest version of cobra (v1.8.1 at the time of writing), and I could not find custom code for this subcommand, so I believe the help message was generated by cobra.
As far as I know, I have not done any configuration to zsh except a few
p10k configure
calls for the theme. From some brief searching, it appears that zsh using either/usr/share
or/usr/local/share
varies based on Linux distro. It is possible that zsh is misconfigured somewhere as well, but I couldn't find anything configuring fpath to use these defaults on my system.The text was updated successfully, but these errors were encountered: