Skip to content

Support for loading shell completion scripts #443

@jcpetruzza

Description

@jcpetruzza

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions