diff options
author | Mick Hohmann <gh@m69.im.net> | 2024-03-20 22:47:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 22:47:32 +0100 |
commit | b8a812b93207da992ff8ae9f8b955bfa1252072b (patch) | |
tree | b68f0a8251be571c173eb2f6fd8f8ea9d672927b /docs/config/README.md | |
parent | aef1a3f275e7ec9095c4718ecf6a268abfe7794a (diff) |
feat(username): add detect_env_vars as option (#5833)
* Added the option "detect_env_vars" to the `username` module
with the same functionality as in the `hostname` module.
* Fixed logic error and added test to catch it
* build(deps): update dependency vitepress to ^1.0.0-rc.45
* build(deps): update rust crate shadow-rs to 0.27.1
* Added the option "detect_env_vars" to the `username` module
with the same functionality as in the `hostname` module.
* Fixed logic error and added test to catch it
* Removed unused gix import
* Removed unused gix import, again
* Removed unused gix import. Next try
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Diffstat (limited to 'docs/config/README.md')
-rw-r--r-- | docs/config/README.md | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/docs/config/README.md b/docs/config/README.md index 1c6f626a1..34beb729d 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -4357,6 +4357,7 @@ The module will be shown if any of the following conditions are met: - The current user isn't the same as the one that is logged in - The user is currently connected as an SSH session - The variable `show_always` is set to true +- The array `detect_env_vars` contains at least the name of one environment variable, that is set ::: tip @@ -4368,13 +4369,14 @@ these variables, one workaround is to set one of them with a dummy value. ### Options -| Option | Default | Description | -| ------------- | ----------------------- | ------------------------------------------- | -| `style_root` | `'bold red'` | The style used when the user is root/admin. | -| `style_user` | `'bold yellow'` | The style used for non-root users. | -| `format` | `'[$user]($style) in '` | The format for the module. | -| `show_always` | `false` | Always shows the `username` module. | -| `disabled` | `false` | Disables the `username` module. | +| Option | Default | Description | +| ----------------- | ----------------------- | --------------------------------------------------------- | +| `style_root` | `'bold red'` | The style used when the user is root/admin. | +| `style_user` | `'bold yellow'` | The style used for non-root users. | +| `detect_env_vars` | `[]` | Which environment variable(s) should trigger this module. | +| `format` | `'[$user]($style) in '` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -4385,6 +4387,8 @@ these variables, one workaround is to set one of them with a dummy value. ### Example +#### Always show the hostname + ```toml # ~/.config/starship.toml @@ -4396,6 +4400,17 @@ disabled = false show_always = true ``` +#### Hide the hostname in remote tmux sessions + +```toml +# ~/.config/starship.toml + +[hostname] +ssh_only = false +detect_env_vars = ['!TMUX', 'SSH_CONNECTION'] +disabled = false +``` + ## Vagrant The `vagrant` module shows the currently installed version of [Vagrant](https://www.vagrantup.com/). |