Skip to content

Is $env.NU_LIB_DIRS auto-populated? #2096

@james-smith-za

Description

@james-smith-za

Reading the following lines:

- `$env.XDG_DATA_HOME`: If this environment variable is set, Nushell sets the `$nu.data-dir` constant to this value. The `data-dir` is used in several startup tasks:
- `($nu.data-dir)/completions` is added to the `$env.NU_LIB_DIRS` search path.

My initial understanding of this passage was that if $env.XDG_DATA_HOME is and ($nu.data-dir)/completions exists, then it gets added to $env.NU_LIB_DIRS automatically on nushell startup. However, looking around at what people report from their own configs, it appears that $env.NU_LIB_DIRS has to be built up somewhat manually. Indeed, in my own case, XDG_DATA_HOME is set and the completions dir exists, but if I don't manually build $env.NU_LIB_DIRS, then it's just empty.

Have I misunderstood something here? Happy to contribute a PR with a doc update to clarify, if someone is willing to help me understand what the correct behaviour is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions