Open abennett opened 10 months ago
For now I add the following workaround to my ~/.zshrc file:
if command -v aws > /dev/null 2>&1; then
for p in ${(ps. .)NIX_PROFILES}; do
f="${p}/share/zsh/site-functions/_aws"
if [ -r "${f}" ]; then
source "${f}"
break
fi
done
fi
I agree that this should not be necessary, though.
I did notice that this _aws_zshcompleter.zsh file has been in use since at least #91655 almost four years ago. Whether the content of that file changed such that it is no longer amenable to autoloading is harder to say.
Assuming that the upstream file comes from aws/aws-cli, the file's content hasn't changed for almost two years.
Describe the bug
The
postInstall
step ofawscli2
is generating an autocompletion file incompatible with zsh compdef. The file it's currently generating is a file that needs to be sourced, not a#compdef
file that will be autoloaded by zsh.https://github.com/NixOS/nixpkgs/blob/057f9aecfb71c4437d2b27d3323df7f93c010b7e/pkgs/tools/admin/awscli2/default.nix#L97-L99
Steps To Reproduce
Steps to reproduce the behavior:
awscli2
Expected behavior
Tab completions works as expected for the various
aws
subcommands and options.Additional context
I appreciate your work!
Here's what the _aws autocompletion file looks like. Even looking at the aws docs for autocompletion, it looks like they are also expecting a sourcing of the file. I'm not familiar with the zsh autocompletion system enough to propose a solution offhand.
Notify maintainers
@bhipple @davegallant @bryanasdev000 @devusb @anthonyroussel
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.