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 shell completion (zsh) #1992

Closed
blueyed opened this issue Oct 8, 2016 · 4 comments
Closed

Add shell completion (zsh) #1992

blueyed opened this issue Oct 8, 2016 · 4 comments
Labels
plugin: argcomplete related to the argcomplete builtin plugin type: enhancement new feature or API change, should be merged into features branch

Comments

@blueyed
Copy link
Contributor

blueyed commented Oct 8, 2016

Should we include/ship shell completion with pytest, e.g. in a contrib folder?

I have something for Zsh: https://github.com/zsh-users/zsh-completions/pull/454/files.

Added to my dotfiles: blueyed/oh-my-zsh@fd89b19 (2020-03-01)

@blueyed blueyed added type: enhancement new feature or API change, should be merged into features branch type: question general question, might be closed after 2 weeks of inactivity labels Oct 8, 2016
@RonnyPfannschmidt
Copy link
Member

pytest already supports the argcomplete protocol

@blueyed
Copy link
Contributor Author

blueyed commented Oct 8, 2016

Thanks!
I came across that before, but for zsh it requires bashcompinit (a wrapper to enable bash completions), and the completion itself is slow (it seems to be not cached at all), and does not support completing (c)tags after -k, which was my initial motivation to create a completion script for pytest, since this easily allows to complete test functions.

@RonnyPfannschmidt
Copy link
Member

i see what you mean, i wonder if that can be done in a multi shell fashion

@nicoddemus nicoddemus added the plugin: argcomplete related to the argcomplete builtin plugin label Dec 12, 2017
@nicoddemus nicoddemus removed the type: question general question, might be closed after 2 weeks of inactivity label Jan 23, 2018
@blueyed blueyed closed this as completed Nov 27, 2019
@blueyed blueyed changed the title Add shell completion Add shell completion (zsh) Mar 1, 2020
@Freed-Wu
Copy link

How about shtab? It is faster than argcomplete and pyzshcomplete. And it supports more shells.

Freed-Wu added a commit to Freed-Wu/pytest that referenced this issue Sep 17, 2022
See pytest-dev#1992

pytest --print-completion bash | sudo tee /usr/share/bash-completion/completions/pytest
pytest --print-completion tcsh | sudo tee /etc/profile.d/pytest.completion.csh
pytest --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pytest
Freed-Wu added a commit to Freed-Wu/pytest that referenced this issue Sep 17, 2022
See pytest-dev#1992

pytest --print-completion bash | sudo tee /usr/share/bash-completion/completions/pytest
pytest --print-completion tcsh | sudo tee /etc/profile.d/pytest.completion.csh
pytest --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pytest
Freed-Wu added a commit to Freed-Wu/pytest that referenced this issue Sep 18, 2022
See pytest-dev#1992

pytest --print-completion bash | sudo tee /usr/share/bash-completion/completions/pytest
pytest --print-completion tcsh | sudo tee /etc/profile.d/pytest.completion.csh
pytest --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pytest
Freed-Wu added a commit to Freed-Wu/pytest that referenced this issue Sep 18, 2022
See pytest-dev#1992

pytest --print-completion bash | sudo tee /usr/share/bash-completion/completions/pytest
pytest --print-completion tcsh | sudo tee /etc/profile.d/pytest.completion.csh
pytest --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pytest
Freed-Wu added a commit to Freed-Wu/pytest that referenced this issue Sep 18, 2022
See pytest-dev#1992

pytest --print-completion bash | sudo tee /usr/share/bash-completion/completions/pytest
pytest --print-completion tcsh | sudo tee /etc/profile.d/pytest.completion.csh
pytest --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pytest
Freed-Wu added a commit to Freed-Wu/pytest that referenced this issue Sep 18, 2022
See pytest-dev#1992

pytest --print-completion bash | sudo tee /usr/share/bash-completion/completions/pytest
pytest --print-completion tcsh | sudo tee /etc/profile.d/pytest.completion.csh
pytest --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pytest
Freed-Wu added a commit to Freed-Wu/pytest that referenced this issue Sep 18, 2022
See pytest-dev#1992

pytest --print-completion bash | sudo tee /usr/share/bash-completion/completions/pytest
pytest --print-completion tcsh | sudo tee /etc/profile.d/pytest.completion.csh
pytest --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: argcomplete related to the argcomplete builtin plugin type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

4 participants