Home Explore Blog CI



nushell

11th chunk of `book/configuration.md`
05dbf047764aafb52968f8140b856c9635f64c272d482fdf0000000100001018
| 17.  | (repl)                          | Sets several default environment variables that only apply in the REPL (prompt-related and `SHLVL`). Note that prompt-related variables using closures are set in `default_env.nu`.                                                                                                                                                                                            |
| 18.  | (config files) (plugin)         | Processes the signatures in the user's `plugin.msgpackz` (located in the configuration directory) so that added plugins can be used in the following config files.                                                                                                                                                                                                             |
| 19.  | (config files)                  | If this is the first time Nushell has been launched, then it creates the configuration directory. "First launch" is determined by whether or not the configuration directory exists.                                                                                                                                                                                           |
| 20.  | (config files)                  | Also, if this is the first time Nushell has been launched, creates a mostly empty (other than a few comments) `env.nu` and `config .nu` in that directory.                                                                                                                                                                                                                     |
| 21.  | (config files) (default_env.nu) | Loads default environment variables from the internal `default_env.nu`. This file can be viewed with: `nu config env --default \| nu-highlight \| less -R`.                                                                                                                                                                                                                    |
| 22.  | (config files) (env.nu)         | Converts the `PATH` variable into a list so that it can be accessed more easily in the next step.                                                                                                                                                                                                                                                                              |
| 23.  | (config files) (env.nu)         | Loads (parses and evaluates) the user's `env.nu` (the path to which was determined above).                                                                                                                                                                                                                                                                                     |
| 24.  | (config files) (config.nu)      | Loads a minimal `$env.config` record from the internal `default_config.nu`. This file can be viewed with: `nu config nu --default \| nu-highlight \| less -R`. Most values that are not defined in `default_config.nu` will be auto-populated into `$env.config` using their internal defaults as well.                                                                        |
| 25.  | (config files) (config.nu)      | Loads (parses and evaluates) the user's `config.nu` (the path to which was determined above).                                                                                                                                                                                                                                                                                  |
| 26.  | (config files) (login)          | When Nushell is running as a login shell, loads the user's `login.nu`.                                                                                                                                                                                                                                                                                                         |

Title: Nushell Configuration Files: Setup, Environment, and Customization
Summary
This section describes how Nushell handles configuration files during startup, including setting REPL-specific environment variables, processing plugin signatures, creating the configuration directory and default `env.nu` and `config.nu` files if it's the first launch, loading default environment variables from `default_env.nu`, converting the `PATH` variable to a list, loading the user's `env.nu` and `config.nu`, loading a minimal `$env.config` record from `default_config.nu` and loading the user's `login.nu` if running as a login shell.