feat: add hostname module (#286)

Add a hostname module as requested by @chipbuster.
Displays the system hostname as provided by gethostname.
This commit is contained in:
Andrew Houts
2019-09-04 10:03:31 -07:00
committed by Matan Kushner
parent 5a0f269d85
commit 84688e4981
8 changed files with 198 additions and 0 deletions
+26
View File
@@ -69,6 +69,7 @@ The `default_prompt_order` configuration option is used to define the order in w
```
default_prompt_order = [
"username",
"hostname",
"directory",
"git_branch",
"git_status",
@@ -268,6 +269,31 @@ renamed = "👅"
deleted = "🗑"
```
## Hostname
The `hostname` module shows the system hostname.
### Options
| Variable | Default | Description |
| ------------ | ------- | ------------------------------------------------------- |
| `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `prefix` | `""` | Prefix to display immediately before the hostname. |
| `suffix` | `""` | Suffix to display immediately after the hostname. |
| `disabled` | `false` | Disables the `hostname` module. |
### Example
```toml
# ~/.config/starship.toml
[hostname]
ssh_only = false
prefix = "⟪"
suffix = "⟫"
disabled = false
```
## Golang
The `golang` module shows the currently installed version of Golang.