mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
feat(hostname): add option to replace hostnames with aliases (#6097)
--------- Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
+10
-1
@@ -2355,6 +2355,7 @@ The `hostname` module shows the system hostname.
|
||||
| `format` | `'[$ssh_symbol$hostname]($style) in '` | The format for the module. |
|
||||
| `style` | `'bold dimmed green'` | The style for the module. |
|
||||
| `disabled` | `false` | Disables the `hostname` module. |
|
||||
| `aliases` | `{}` | Translate system hostnames to something else. If `trim_at` is specified, only the first part will be matched and replaced. |
|
||||
|
||||
### Variables
|
||||
|
||||
@@ -2391,6 +2392,14 @@ detect_env_vars = ['!TMUX', 'SSH_CONNECTION']
|
||||
disabled = false
|
||||
```
|
||||
|
||||
#### Replace the hostname with a nickname
|
||||
|
||||
```toml
|
||||
# ~/.config/starship.toml
|
||||
[hostname]
|
||||
aliases = { "Max's MacBook Pro" = "home" }
|
||||
```
|
||||
|
||||
## Java
|
||||
|
||||
The `java` module shows the currently installed version of [Java](https://www.oracle.com/java/).
|
||||
@@ -4539,7 +4548,7 @@ these variables, one workaround is to set one of them with a dummy value.
|
||||
| `format` | `'[$user]($style) in '` | The format for the module. |
|
||||
| `show_always` | `false` | Always shows the `username` module. |
|
||||
| `disabled` | `false` | Disables the `username` module. |
|
||||
| `aliases` | `{}` | Translate system usernames to something else |
|
||||
| `aliases` | `{}` | Translate system usernames to something else. |
|
||||
|
||||
### Variables
|
||||
|
||||
|
||||
Reference in New Issue
Block a user