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 zsh and bash shell completion #4

Open
srid opened this issue Dec 17, 2022 · 4 comments
Open

Add zsh and bash shell completion #4

srid opened this issue Dec 17, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@srid
Copy link
Member

srid commented Dec 17, 2022

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:

# TODO: bash and zsh completion
postInstall = (oa.postInstall or "") + ''
'';

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

@srid srid added the enhancement New feature or request label Dec 17, 2022
@srid srid pinned this issue Dec 17, 2022
@srid
Copy link
Member Author

srid commented Dec 19, 2022

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

@srid
Copy link
Member Author

srid commented Jan 3, 2023

@srid srid added the help wanted Extra attention is needed label Jan 29, 2023
@srid
Copy link
Member Author

srid commented Jan 29, 2023

We have a larger problem: direnv/direnv#443

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

@srid
Copy link
Member Author

srid commented Apr 16, 2024

The alternative we now recommend supports shell completion through just.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant