shazow / foundry.nix

Nix overlay for gakonst/foundry (including forge and cast)
https://github.com/foundry-rs/foundry
MIT License
55 stars 16 forks source link

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

Open mitchmindtree opened 11 months ago

mitchmindtree commented 11 months ago

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:

shazow commented 11 months ago

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.