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

[bug]: zinit creinstall -Q ... or -q is not quiet #518

Open
1 task done
PyroDevil opened this issue May 7, 2023 · 6 comments · May be fixed by #520
Open
1 task done

[bug]: zinit creinstall -Q ... or -q is not quiet #518

PyroDevil opened this issue May 7, 2023 · 6 comments · May be fixed by #520
Assignees
Labels
bug Something isn't working

Comments

@PyroDevil
Copy link

PyroDevil commented May 7, 2023

What happened?

The documentation states that the -q or -Q parameter for zinit creinstall is quiet, but it prints ==> Installed 1 completion.

This is annoying because I have put this command into the zshrc and thus it gets printed on every new shell.

Sure this can be worked around with a >/dev/null, however, IIRC this happend only after a zinit update, so it might be a regression or unintended change.

Steps to reproduce

  1. Use zinit version v3.11.0
  2. put some completion script into a directory, for instance rustup completions zsh cargo > ".config/zsh/completions/_cargo"
  3. execute zinit creinstall -Q ~/.config/zsh/completions and expect no output.

Relevant output

❯ zinit creinstall ~/.config/zsh/completions
Symlinking completion _cargo to completions directory.
Forgetting commands completed by `_cargo': cargo
==> Installed 1 completion
==> Added 1 completion to $INSTALLED_COMPS array
Initializing completion (compinit)…
❯ zinit creinstall -q ~/.config/zsh/completions
==> Installed 1 completion
❯ zinit creinstall -Q ~/.config/zsh/completions
==> Installed 1 completion

Screenshots and recordings

No response

Operating System & Version

OS: linux-gnu | Vendor: pc | Machine: x86_64 | CPU: x86_64 | Processor: unknown | Hardware: x86_64

Zsh version

zsh 5.9 (x86_64-pc-linux-gnu)

Terminal emulator

xterm-256color

If using WSL on Windows, which version of WSL

None

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@PyroDevil PyroDevil added the bug Something isn't working label May 7, 2023
@vladdoster
Copy link
Member

@PyroDevil,

Will fix this soon.

In the meantime, to silence it, append the following snippet:

2>&1 > /dev/null

Example:

Screenshot 2023-05-14 at 00 52 25

@vladdoster vladdoster linked a pull request May 14, 2023 that will close this issue
7 tasks
@vladdoster
Copy link
Member

vladdoster commented May 14, 2023

@PyroDevil,

If you have time, please test the patch.

To update your Zinit install with the patch, run:

zinit self-update
cd "$ZINIT[BIN_DIR]"
git pull --all
git checkout fix/creinstall-command
cd -
exec zsh -il

To go back to the main branch of Zinit, run:

cd "$ZINIT[BIN_DIR]"
git checkout main
cd -
exec zsh -il

@vladdoster
Copy link
Member

@PyroDevil,

Could you elaborate on why you are running creinstall in your zshrc?

@alichtman
Copy link
Member

alichtman commented May 20, 2023

@vladdoster I tested fix/creinstall-command. I get the following error printed at the top of my terminal when the command is zinit creinstall -Q $ZINIT_HOME/completions:

No such (plugin or snippet): -Q.

and using -q, I get the following error:

No such (plugin or snippet): %HOME/.local/share/zinit/zinit.git/completions.

This line works as expected on main.


Anyways, silencing by piping output to /dev/null works (but is messy).

The reason I'm running creinstall is to get a custom completion I'm adding to be recognized:

rustup completions zsh cargo > "$ZINIT[HOME_DIR]/completions/_cargo"

# Install my custom completions
zinit creinstall -Q $ZINIT_HOME/completions 2>&1 > /dev/null

This comes almost directly from the example in the README:

# Handle completions without loading any plugin; see "clist" command.
# This one is to be ran just once, in interactive session.
zi creinstall %HOME/my_completions

@PyroDevil
Copy link
Author

@vladdoster

Sorry for the delay. I tested fix/creinstall creinstall -q or creinstall -Q prints ==> Skipped re-installing 1 completion.

So that is not fixed there.

The reason I use creinstall in .zshrc is the same as @alichtman.

@Turiok
Copy link

Turiok commented Jul 19, 2024

I have the same problem.
I'm using poetry and kubectl completion from OMZP. I have to creinstall to add theses completions.

This is related to #652 . I'm using the kubectl OMZP plugin. But the zsh file generate the completion file in $ZSH_CACHE_DIR/completions so I'm using creinstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants