prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.38k stars 192 forks source link

Pixi fish completion breaks fish-native completion #1906

Open jonashaag opened 2 months ago

jonashaag commented 2 months ago

Checks

Reproducible example

Type

pixi run python <TAB>

Options offered by fish (my Pixi tasks):

pixi run python
bench              test         lint     ...

Issue description

Since a recent release of Pixi the completions for fish hinder fish from using proper completion for anything that's not a Pixi task. This includes the lack of filename completion, see example above. Completions offer only Pixi tasks even in places where it doesn't make sense (see example above).

Expected behavior

Should allow filename completion and task name completion only in places where a task is expected.

tdejager commented 2 months ago

Yeah you are right, this has recently changed. But how do you want the completion to function? Because python being completed was more of a side-effect, probably because it was on your global path?

ruben-arts commented 2 months ago

The problem is that the auto-completion always completes the tasks, even if there is already a task.

jonashaag commented 2 months ago

Also, I always want pixi run py<TAB> to complete python

Edit: although I understand the decision to only show tasks. But it would be nice to complete both tasks and binaries in the envs' PATHs.

How do other package managers do this?

tdejager commented 2 months ago

The problem is that the auto-completion always completes the tasks, even if there is already a task.

Yeah, let me see if we can work around this later. Does this not do this for bash?

ruben-arts commented 2 months ago

Does this not do this for bash?

It doesn't seem to behave the same:

pixi on  main [!⇡] is 📦 v0.28.1 via 🦀 v1.80.0 
❯ pixi run test
test              test-all          test-integration  test-schema

pixi on  main [!⇡] is 📦 v0.28.1 via 🦀 v1.80.0 
❯ pixi run test te
tests/ 
ruben-arts commented 2 months ago

We should take a look at the auto-completion after the first completion. But we don't autocomplete more than just until there is an actual solution to dynamic completion in clap as the maintenance of these scripts is not fun. Writing completion scripts per shell is a major slowdown on the development effort.

jonashaag commented 2 weeks ago

Would be nice if this was fixed. Do you know how to disable autocomplete in the meantime? (I install Pixi from Homebrew)

jonashaag commented 1 week ago

My workaround:

# https://github.com/prefix-dev/pixi/issues/1906
if find /opt/homebrew/Cellar/pixi/*/share/fish/vendor_completions.d | grep pixi.fish
  /bin/rm -f /opt/homebrew/Cellar/pixi/*/share/fish/vendor_completions.d/pixi.fish
end