Closed r0uv3n closed 8 months ago
Thanks for the link. I've put sth. together, let's see if it works...
Hi I'm trying to test this right now (am on commit c79961be8d9876ffb71cf2bc7c2a338fa4ab5569 of carapace-bin) and tried to manually use the bridge using carapace --macro bridge.Bash "c"
(to get autocompletions starting with "c"), but I get back
{"version":"v0.50.0","messages":["missing argument [ActionBash]"],"nospace":"","usage":"","values":[]}
Am I passing in the command to autocomplete wrong or something similar? Doing carapace --macro bridge.CarapaceBin "c"
instead works just fine.
bridge.CarapaceBin
completes path executables as first position arguments are optional.
bridge.Bash
does not and needs at least one argument. Might be good to support this there as well though.
I think it isn't working yet. Setting up nix is a bit of trouble, but I'm looking into it.
So it works for me now.
.bash
suffix which needed to be trimmed
bridge.CarapaceBin
completes path executables as first position arguments are optional.bridge.Bash
does not and needs at least one argument. Might be good to support this there as well though.
I think I got the argument passing to work? Is the following correct?
carapace --macro bridge.Bash(["c"]) -h
Without the -h
it doesn't seem to output anything. The output is still not what one would want, but at least I don't get the missing argument
message anymore:
{"version":"v0.50.0","messages":[],"nospace":",./:=@","usage":"","values":[]}
I'm on commit 31bd8bb right now. Am I using the command wrong? Or can I help in some other way in debugging this?
Quotes are important due to the round brackets:
carapace --macro 'bridge.Bash(["git"])' ""
Ah yes, thank you, that works now! But completions for nixos-rebuild
(should offer boot
, build
, etc.) still don't work, and similarly for e.g. nixos-install
. Completions for the nixos-
commands on my system are under /run/current-system/sw/share/bash-completion/completions
(which is in $XDG_DATA_DIRS
).
- list of completions is cached which needed to be cleared
Could it be that I still need to do this?
You should have a carapace --clear-cache
command now, try that one.
Yes, that works! Thanks a lot!
On NixOS, completions are often surfaced to
bash
(and shells with compatible completers) via $XDG_DATA_DIRS. I tried to usenushell
withcarapace
's bridge tobash
enabled, but none of these completions were found, sincecarapace
only looks in the directories listed here.Contrast this with where
bash
looks for completions, listed in thebash-completion
FAQ:The relevant code in the
bashrc
file is here.It would be great if
carapace
could look in all of these directories as well. I'm not familiar withgo
, otherwise I'd just directly submit a PR. Do you have time to look into this? Otherwise I might try to figure this out myself some time later, and submit a PR, but that could take a while.