Platonic-Systems / mission-control

A `flake-parts` module for your Nix devshell scripts
https://community.flake.parts/mission-control
MIT License
71 stars 12 forks source link

Add zsh and bash shell completion #4

Open srid opened 1 year ago

srid commented 1 year ago

In the example nix shell, typing , followed by hitting the TAB should auto-complete the user-configured script names (hello and fmt in the case of the example). This should work on both bash and zsh (inasmuch as macOS uses zsh by default).

The code for this could potentially go here:

https://github.com/Platonic-Systems/mission-control/blob/3b1c773f4677b4b892b85363ea252f2be00f7d7d/nix/wrapper.nix#L48-L50

For reference, see how purs-nix implements it: https://github.com/purs-nix/purs-nix/blob/0fae0fd9316a20e2312cfdbcb8135b0e56330e01/purs-nix-command.nix#L254-L271

srid commented 1 year ago

Should also add -h and --help to the completion list.

srid commented 1 year ago

https://stackoverflow.com/a/74981309/55246

srid commented 1 year ago

We have a larger problem: https://github.com/direnv/direnv/issues/443

Even nix develop doesn't provide shell completion for nativeBuildInputs (eg: exa).

srid commented 3 months ago

The alternative we now recommend supports shell completion through just.

See https://github.com/juspay/just-flake