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

pixi run should invoke the shell's autocompletion #372

Closed
pavelzw opened this issue Oct 3, 2023 · 5 comments
Closed

pixi run should invoke the shell's autocompletion #372

pavelzw opened this issue Oct 3, 2023 · 5 comments
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers

Comments

@pavelzw
Copy link
Contributor

pavelzw commented Oct 3, 2023

Problem description

It would be nice to be able to invoke the shell's autocompletion when using pixi run.

pixi run b<tab>
# becomes
pixi run build

# if no matching pixi task is found, the shell's autocompletion could be called
pixi run git ch<tab>
# becomes
pixi run git checkout
@pavelzw pavelzw added the ✨ enhancement Feature request label Oct 3, 2023
@baszalmstra
Copy link
Contributor

Slightly related to #136

baszalmstra pushed a commit that referenced this issue Oct 19, 2023
Adds auto completion for `pixi run <TAB TAB>` in `bash` and `zsh` .

closes #383 but not yet #372 as it doesn't activate the environment.
@ruben-arts
Copy link
Contributor

This is now in v0.7.0 for bash and zsh.
We still need support for the other shell's.

If anyone wants to give it a go, checkout the replace functions in this file

@ruben-arts ruben-arts added the 👋 good first issue Good for newcomers label Nov 15, 2023
@pavelzw
Copy link
Contributor Author

pavelzw commented Feb 5, 2024

This is now in v0.7.0 for bash and zsh.

@ruben-arts is it? Or did you only mean the first part?

With the latest pixi version on zsh, I get

❯ pixi run git ch<TAB>
--color              -- Whether the log needs to be colored
--environment    -e  --
--frozen             -- Don't check or update the lockfile, continue with prev
--help           -h  -- Print help
--locked             -- Check if lockfile is up to date, aborts when lockfile
--manifest-path      -- The path to 'pixi.toml'
--quiet          -q  -- Decrease logging verbosity
--verbose        -v  -- Increase logging verbosity
                          postinstall               test

instead of

❯ pixi run git ch<TAB>
check-attr       -- display gitattributes information
check-ignore     -- debug gitignore/exclude files
check-mailmap    -- show canonical names and email addresses of contacts
check-ref-format -- ensure that a reference name is well formed
checkout         -- checkout branch or paths to working tree
checkout-index   -- copy files from index to working directory
cherry           -- find commits not merged upstream
cherry-pick      -- apply changes introduced by some existing commit

@pavelzw pavelzw changed the title pixi run autocompletion pixi run should invoke the shell's autocompletion Feb 5, 2024
@ruben-arts
Copy link
Contributor

The task name autocompletion is in, I don't see a way we'll ever be able to comfortably implement the activated environment autocompletion passthrough.

@ruben-arts
Copy link
Contributor

We're not going to be able to do this anytime soon because of the activation and no dynamic completion in clap. Closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants