carapace-bin
carapace-bin copied to clipboard
nom-build: zsh bridge does not work
Current Behavior
Attempting to complete nom-build
which ships a zsh-completion in CARAPACE_BRIDGES=zsh nu
does not work: NO RECORDS FOUND
.
Perhaps this is to do with the completion being equal to some other completion?
Expected Behavior
It should do zsh nix-build
completions for nom-build
.
Steps To Reproduce
- In an env where zsh and nix-output-monitor are installed
- Run
CARAPACE_BRIDGES=zsh nu
- Try to complete
nom-build <TAB>
Version
1.0.2
OS
- [X] Linux
- [ ] OSX
- [ ] Windows
Shell
- [ ] Bash
- [ ] Elvish
- [ ] Fish
- [X] Nushell
- [ ] Oil
- [ ] Powershell
- [ ] Xonsh
- [ ] Zsh
Anything else?
Nom basically declares itself as an alias. That may be the reason?
Related to this: Should carapace attempt to use its own completions for the command aliased by the bridge or should it use the bridge's aliased command via the bridge too?
Least surprise would probably be to use the aliased command completion via the bridge as command aliases should be handled by carapace itself for native completions.
Nom basically declares itself as an alias. That may be the reason?
Yeah possibly. Haven't gone too deeply into that edge case.
Apart from that carapace uses a custom config at ~/.config/carapace/bridge/zsh/.zshrc
, so if the nom-build
completion is registerd in ~/.zshrc
that needs to be repeated there.
There's a custom completer for nix-build
in carapace. Might be easier to just bridge completions for that one with a spec:
# yaml-language-server: $schema=https://carapace.sh/schemas/command.json
name: nom-build
parsing: disabled
completion:
positionalany: ["$carapace.bridge.CarapaceBin([nix-build])"]
Oh so that's what the carapace bridge is for; it struck me as kind of odd.
Sourcing the users .zshrc
can be very slow (depending on whate users put in there) and have some nasty side effects.
So I'm kinda forced to use a seperate one.
System wide registered completions should work though.
Ah, sorry I forgot to reply to that part; this is indeed a system-wide completion. It's not at the usual path as I'm on NixOS but the default system zsh is made to discover it just fine.