mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat(env_var): Add support for env_var.VAR in format (#4497)
Co-Authored-By: Segev Finer <24731903+segevfiner@users.noreply.github.com> Co-authored-by: Segev Finer <24731903+segevfiner@users.noreply.github.com>
This commit is contained in:
+16
-7
@@ -1380,6 +1380,14 @@ The module will be shown only if any of the following conditions are met:
|
||||
|
||||
::: tip
|
||||
|
||||
The order in which env_var modules are shown can be individually set by including
|
||||
`${env_var.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`).
|
||||
By default, the `env_var` module will simply show all env_var modules in the order they were defined.
|
||||
|
||||
:::
|
||||
|
||||
::: tip
|
||||
|
||||
Multiple environmental variables can be displayed by using a `.`. (see example)
|
||||
If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character.
|
||||
|
||||
@@ -1396,13 +1404,14 @@ default = 'unknown user'
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Default | Description |
|
||||
| ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
|
||||
| `symbol` | `''` | The symbol used before displaying the variable value. |
|
||||
| `variable` | | The environment variable to be displayed. |
|
||||
| `default` | | The default value to be displayed when the selected variable is not defined. |
|
||||
| `format` | `'with [$env_value]($style) '` | The format for the module. |
|
||||
| `disabled` | `false` | Disables the `env_var` module. |
|
||||
| Option | Default | Description |
|
||||
| ------------- | ------------------------------ | ---------------------------------------------------------------------------- |
|
||||
| `symbol` | `""` | The symbol used before displaying the variable value. |
|
||||
| `variable` | | The environment variable to be displayed. |
|
||||
| `default` | | The default value to be displayed when the selected variable is not defined. |
|
||||
| `format` | `"with [$env_value]($style) "` | The format for the module. |
|
||||
| `description` | `"<env_var module>"` | The description of the module that is shown when running `starship explain`. |
|
||||
| `disabled` | `false` | Disables the `env_var` module. |
|
||||
|
||||
### Variables
|
||||
|
||||
|
||||
Reference in New Issue
Block a user