feat(hostname): add ssh_symbol for ssh connections (#3806)

This commit is contained in:
Thanapat Chotipun
2022-05-04 20:30:16 +07:00
committed by GitHub
parent 3ced500c87
commit 2bf30dc89f
4 changed files with 53 additions and 17 deletions
+14 -12
View File
@@ -1805,20 +1805,22 @@ The `hostname` module shows the system hostname.
### Options
| Option | Default | Description |
| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation |
| `format` | `"[$hostname]($style) in "` | The format for the module. |
| `style` | `"bold dimmed green"` | The style for the module. |
| `disabled` | `false` | Disables the `hostname` module. |
| Option | Default | Description |
| ------------ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `ssh_symbol` | `"🌐 "` | A format string representing the symbol when connected to SSH session. |
| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation |
| `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. |
### Variables
| Variable | Example | Description |
| -------- | ---------- | ----------------------------------- |
| hostname | `computer` | The hostname of the computer |
| style\* | | Mirrors the value of option `style` |
| Variable | Example | Description |
| ---------- | ---------- | ----------------------------------------------------- |
| hostname | `computer` | The hostname of the computer |
| style\* | | Mirrors the value of option `style` |
| ssh_symbol | `"🌏 "` | The symbol to represent when connected to SSH session |
*: This variable can only be used as a part of a style string
@@ -1829,7 +1831,7 @@ The `hostname` module shows the system hostname.
[hostname]
ssh_only = false
format = "on [$hostname](bold red) "
format = "[$ssh_symbol](bold blue) on [$hostname](bold red) "
trim_at = ".companyname.com"
disabled = false
```