Skip to content

docs(wrapperModules.nushell): add notes about the differences to normal config file placement#559

Open
Noah765 wants to merge 1 commit into
BirdeeHub:mainfrom
Noah765:nushell
Open

docs(wrapperModules.nushell): add notes about the differences to normal config file placement#559
Noah765 wants to merge 1 commit into
BirdeeHub:mainfrom
Noah765:nushell

Conversation

@Noah765

@Noah765 Noah765 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

See https://www.nushell.sh/book/configuration.html#flag-behavior.

Outdated summary The problem with setting the `--config` flag is that the configuration is loaded even in non-interactive environments. See https://www.nushell.sh/book/configuration.html#scenarios.

Note that this is a breaking change since it changes $nu.default-config-dir and affects the location of the history file, which has to be set to a non-Nix store location using $env.config.history.path. If you feel like this trade-off isn't worthwhile or have any suggestions, please suggest them or close this PR.

@BirdeeHub

Copy link
Copy Markdown
Owner

Hey! Sorry, took me a bit to get to this.

I recognize that the current nushell module is not great and will need to be improved.

However I am hesitant to export XDG_CONFIG_HOME for a whole shell. For many programs this is not so important, but this is a shell, and it will thus affect all the programs you launch using the shell. Is there a way we can use a different variable, or reset it before any of the user provided config and runtime code gets called?

@Noah765 Noah765 changed the title fix(wrapperModules.nushell): set XDG_CONFIG_HOME instead of flags, add login.nu docs(wrapperModules.nushell): add notes about the differences to normal config file placement Jun 16, 2026
@Noah765

Noah765 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Hey! Sorry, took me a bit to get to this.

Don't worry — you're doing a great job here, and it's just a hobby project after all!

However I am hesitant to export XDG_CONFIG_HOME for a whole shell. For many programs this is not so important, but this is a shell, and it will thus affect all the programs you launch using the shell. Is there a way we can use a different variable, or reset it before any of the user provided config and runtime code gets called?

I don't think there is another variable that can be used to configure the config path, and I cannot think of a way to reset XDG_CONFIG_HOME without using more flags which would change the behavior of Nushell in more unexpected ways. Furthermore, $nu.default-config-dir is set to $XDG_CONFIG_HOME/nushell at startup and cannot be changed.
See https://github.com/nushell/nushell/blob/main/crates/nu-path/src/helpers.rs#L22 and https://github.com/nushell/nushell/blob/main/src/config_files.rs#L58.

I believe that using the --config and --env-config is the least destructive option, so I updated this PR to add some clarifying documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants