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

Add install instructions for zsh on Mac OS #1417

Merged
merged 1 commit into from Jul 1, 2021
Merged

Conversation

@kylelemons
Copy link
Contributor

@kylelemons kylelemons commented Jun 10, 2021

zsh is now the default on Mac OS, but the $_fpath version of the installation instructions are likely to put the completion in a strange location that the user might not expect (e.g. an oh-my-zsh plugin's function directory). So, since Mac OS seems to (as far as I can tell) provide a stable location, this PR recommends using that path instead.

zsh is now the default on Mac OS, but the $_fpath version of the installation instructions are likely to put the completion in a strange location that the user might not expect (e.g. an oh-my-zsh plugin's function directory).  So, since Mac OS seems to (as far as I can tell) provide a stable location, this PR recommends using that path instead.
@CLAassistant
Copy link

@CLAassistant CLAassistant commented Jun 10, 2021

CLA assistant check
All committers have signed the CLA.

@marckhouzam
Copy link
Contributor

@marckhouzam marckhouzam commented Jun 22, 2021

Thanks @kylelemons. Thanks for trying to make things clearer for the user, that is super important.

First you will need to sign Cobra's CLA before any PR can be accepted.

I agree that adding the completion script in ${fpath[1]} is quite poor; in my case it is the directory of some random oh-my-zsh plugin.

As for the path /usr/local/share/zsh/site-functions/, I saw that homebrew installs completions there, so I think it is a good choice.

Could you make the same change in the documentation file shell_completions.md?

Finally, can we find a better path on Linux?

@kylelemons
Copy link
Contributor Author

@kylelemons kylelemons commented Jun 29, 2021

First you will need to sign Cobra's CLA before any PR can be accepted.

Sorry for the delay, had to wait on legal for the CLA :).

Could you make the same change in the documentation file shell_completions.md?

Sure.

Finally, can we find a better path on Linux?

Unfortunately linux seems a bit more fragmented, but one high-SEO stack overflow post actually recommends the same directory, so maybe that?

Copy link
Contributor

@marckhouzam marckhouzam left a comment

Finally, can we find a better path on Linux?

Unfortunately linux seems a bit more fragmented, but one high-SEO stack overflow post actually recommends the same directory, so maybe that?

I see you are right that things are fragmented.
I ran a docker zsh image and saw that /usr/share/zsh/site-functions existed but not /usr/local/share/zsh/site-functions.
Same thing after installing zsh on alpine in docker.
But it is the reverse when installing zsh on ubuntu in docker!

So I don't have a good suggestion for a valid path to use.

Let's at least improve things for MacOS with the the change you suggest.

@jpmcb
jpmcb approved these changes Jul 1, 2021
@jpmcb jpmcb merged commit 5738d6b into spf13:master Jul 1, 2021
8 checks passed
8 checks passed
@github-actions
triage
Details
@github-actions
ubuntu | 1.14.x
Details
@github-actions
ubuntu | 1.15.x
Details
@github-actions
macOS | 1.14.x
Details
@github-actions
macOS | 1.15.x
Details
@github-actions
MINGW64
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
This was referenced Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants