Skip to content

Loading/unloading completions dynamically #8261

@jtojnar

Description

@jtojnar

For direnv and other similar tools that modify current shell to place user into a transient development environment, it would be useful if we could dynamically load completions and then have a simple way to unload them. (relevant direnv issue)

Fish scans XDG_DATA_DIRS for vendor completions but, unlike bash-completion, it only does so at startup so when the devenv script is sourced and XDG_DATA_DIRS changes, fish will not notice the new completions.

We could have fish re-scan the directories in XDG_DATA_DIRS if the environment variable changes, load completions in the new directories and unload completions that disappeared. Or, if that would be too inefficient, we could have FISH_ENVIRONMENT_COMPLETIONS environment variable explicitly list the completion script paths.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions