foundry.nix icon indicating copy to clipboard operation
foundry.nix copied to clipboard

Bash completions don't appear to work when using with `nix shell`

Open mitchmindtree opened this issue 2 years ago • 1 comments

Thanks for putting this together!


When I use a shell to access the foundry applications like so:

nix shell github:shazow/foundry.nix

The completions do not appear to work, despite other completions for programs like nix and git working nicely.

Running nix build github:shazow/foundry.nix and then tree result I can see that we do appear to install them:

$ tree result
result
├── bin
│   ├── anvil
│   ├── cast
│   ├── chisel
│   └── forge
└── share
    ├── bash-completion
    │   └── completions
    │       ├── anvil.bash
    │       ├── cast.bash
    │       └── forge.bash
    ├── fish
    │   └── vendor_completions.d
    │       ├── anvil.fish
    │       ├── cast.fish
    │       └── forge.fish
    └── zsh
        └── site-functions
            ├── _anvil
            ├── _cast
            └── _forge

So I'm not sure exactly why this isn't working for me :thinking: The only difference I can see when looking at nix completions is that the nix completions file does not use the .bash suffix:

└── share
    ├── bash-completion
    │   └── completions
    │       └── nix

But I doubt this is relevant, as I assume the existing completions must be working for someone, and many other pkgs in nixpkgs use installShellCompletion.

Any ideas appreciated :pray:

mitchmindtree avatar Dec 04 '23 05:12 mitchmindtree

HMM, good question, I'm not sure. Seems like nix develop is not any better, either.

I appreciate you looking into this, I don't have time today to dive deeper here but would appreciate any fixes here. :)

cc @xiongchenyu6 who did the original PR to add these, in case you have ideas.

shazow avatar Dec 04 '23 18:12 shazow