Closed drmikecrowe closed 3 months ago
@drmikecrowe If you feel there is information useful to others, there is the docs
directory and you can share it there. maybe create a NixOS page?
That said, I don't run NixOS and not sure how I can test this sorta thing? Any suggestions?
I should also mention that tab completion with fish for items with a :
in them (often used for profiles) does not seem to work. The issue is here: https://github.com/synfinatic/aws-sso-cli/blob/main/internal/predictor/predictor.go#L174, where the colon is escaped for bash/zsh. But this is not necessary and breaks fish. Unfortunately, I've get to discover a way to detect the user running the fish shell... attempts to use os.Getenv("FISH_VERSION")
don't seem to work. Curious if you know any tricks?
Curious if you know any tricks?
How about __fish_config_dir
?
root@nas ~# echo $__fish_config_dir
/root/.config/fish
Nope. None of the fish specific variables seem to be exported?
The only other idea I have is to pass in an environment variable indicating fish. Something like:
set -l cmd "__FISH_SHELL=1 {{ .Executable }} list $_args --csv -P Profile=$cur Profile"
Can you share where it breaks? I changed my profiles to use :
and I'm not sure I see what the issue is yet
if you do aws-sso exec -p <tab>
and then when it gets to a colon, aws-sso wants to escape it (foo\:bar
), but fish doing something different than bash/zsh and messing it up: foo\\:bar
which then doesn't match.
anyways, i opened a ticket with fish and see what they say: https://github.com/fish-shell/fish-shell/issues/10553
I think this add a missing fish completion for
aws-sso-profile
command to fish completions. I'm using NixOS, so I had to add this from a test script, but I'm pretty confident this is useful.As an side note, the following is how I'm configuring the completions in my NixOS config. If we had a discussion area or wiki, this might be useful to others. Open to suggestions as to how you want to share: