It would be nice to be able to load new {bash/zsh/etc}-completions from an .envrc script. A typical use case would be when use nix provisions some commands that you don't have globally installed (or are for different versions so their command-line args differ).
This could work for example like this:
- The stdlib provides a new command, say,
add_completions to register completion scripts inside .envrc. E.g.
add_completions bash /path/to/foo/share/bash-completions/completions/
add_completions zsh /path/to/foo/share/zsh/site-functions/
- For each supported shell, their
direnv export action emits, along with the export/unset commands, code to add (and remove) the registered completions.
It would be nice to be able to load new {bash/zsh/etc}-completions from an
.envrcscript. A typical use case would be whenuse nixprovisions some commands that you don't have globally installed (or are for different versions so their command-line args differ).This could work for example like this:
add_completionsto register completion scripts inside.envrc. E.g.direnv exportaction emits, along with theexport/unsetcommands, code to add (and remove) the registered completions.