Skip to content

fix(completion): complete tasks after options in pixi run#6518

Open
hunger wants to merge 4 commits into
prefix-dev:mainfrom
hunger:push-nollukspmxxx
Open

fix(completion): complete tasks after options in pixi run#6518
hunger wants to merge 4 commits into
prefix-dev:mainfrom
hunger:push-nollukspmxxx

Conversation

@hunger

@hunger hunger commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The bash completion for pixi run only suggested task names directly after run. Preserve the clap-generated case "${prev}" block and run task completion after it, so tasks are suggested at any position, e.g. after -e <env> or --frozen. Also deduplicate task names that appear in multiple environments.

Fixes #6494

How Has This Been Tested?

More tests:-)

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@hunger hunger force-pushed the push-nollukspmxxx branch from 05faeb6 to 8135c1c Compare July 3, 2026 11:31
@hunger hunger requested a review from wolfv July 3, 2026 11:32
@hunger

hunger commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

I am not an expert in this part of the code, but this seemed like something claude would probably handle well.

@zakmat

zakmat commented Jul 6, 2026

Copy link
Copy Markdown

I was able to build and can confirm the cases listed in the issue now complete correctly. Thanks!

While you at it is there much work to also improve the completion of -e / --environment?

pixi run -e <TAB> # completes incorrectly to the file list while it should suggest "test" env
pixi run -e t<TAB> # no completion suggested, should complete "test"

@hunger hunger requested a review from Hofer-Julian July 8, 2026 12:33
@hunger hunger force-pushed the push-nollukspmxxx branch from 634d597 to 2ffc175 Compare July 8, 2026 13:56
@hunger

hunger commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Newest version has --environment as well as --platform covered in addition to your original report.

@hunger hunger force-pushed the push-nollukspmxxx branch 2 times, most recently from 0900cb7 to a555f43 Compare July 9, 2026 09:00
hunger and others added 3 commits July 9, 2026 14:28
The bash completion for `pixi run` only suggested task names directly
after `run`. Preserve the clap-generated `case "${prev}"` block and run
task completion after it, so tasks are suggested at any position, e.g.
after `-e <env>` or `--frozen`. Also deduplicate task names that appear
in multiple environments.

Fixes prefix-dev#6494
…`pixi run`

Bash, zsh, and fish completed the `-e`/`--environment` option value as
file paths. Complete workspace environment names instead, mirroring the
task completion. Add a hidden `--machine-readable` flag to
`pixi workspace environment list` that the scripts call for the names.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…run`

Bash, zsh, fish, and nushell completed the `-p`/`--platform` option value
as file paths. Complete workspace platform names instead, mirroring the
environment completion. Add a hidden `--machine-readable` flag to
`pixi workspace platform list` that the scripts call for the names.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hunger hunger force-pushed the push-nollukspmxxx branch from a555f43 to 2fd3b51 Compare July 9, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pixi run task Bash completion breaks after -e flag

3 participants