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

nom-build: zsh bridge does not work #2375

Open
2 of 11 tasks
Atemu opened this issue May 6, 2024 · 4 comments
Open
2 of 11 tasks

nom-build: zsh bridge does not work #2375

Atemu opened this issue May 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Atemu
Copy link

Atemu commented May 6, 2024

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

  1. In an env where zsh and nix-output-monitor are installed
  2. Run CARAPACE_BRIDGES=zsh nu
  3. Try to complete nom-build <TAB>

Version

1.0.2

OS

  • Linux
  • OSX
  • Windows

Shell

  • Bash
  • Elvish
  • Fish
  • 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.

@Atemu Atemu added the bug Something isn't working label May 6, 2024
@rsteube
Copy link
Member

rsteube commented May 6, 2024

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])"]

@Atemu
Copy link
Author

Atemu commented May 6, 2024

Oh so that's what the carapace bridge is for; it struck me as kind of odd.

@rsteube
Copy link
Member

rsteube commented May 6, 2024

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.

@Atemu
Copy link
Author

Atemu commented May 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants