2020-10-05 02:33:12 -07:00
|
|
|
---
|
|
|
|
id: session
|
|
|
|
title: Session
|
|
|
|
sidebar_label: Session
|
|
|
|
---
|
|
|
|
|
|
|
|
## What
|
|
|
|
|
|
|
|
Show the current user and host name.
|
|
|
|
|
|
|
|
## Sample Configuration
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "session",
|
2022-01-17 04:16:04 -08:00
|
|
|
"style": "diamond",
|
2020-10-05 02:33:12 -07:00
|
|
|
"foreground": "#ffffff",
|
|
|
|
"background": "#c386f1",
|
2020-10-16 08:12:34 -07:00
|
|
|
"leading_diamond": "\uE0B6",
|
2021-12-03 14:44:58 -08:00
|
|
|
"trailing_diamond": "\uE0B0",
|
2022-03-27 01:12:47 -07:00
|
|
|
"template": "{{ if .SSHSession }}\uF817 {{ end }}{{ .UserName }}"
|
2020-10-05 02:33:12 -07:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-02-01 03:10:46 -08:00
|
|
|
## Template ([info][templates])
|
|
|
|
|
|
|
|
:::note default template
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
```template
|
2022-02-01 03:10:46 -08:00
|
|
|
{{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }}@{{ .HostName }}
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
### Properties
|
2021-02-15 03:53:28 -08:00
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- | --------- | -------------------------------- |
|
|
|
|
| `.UserName` | `string` | the current user's name |
|
|
|
|
| `.HostName` | `string` | the current computer's name |
|
|
|
|
| `.SSHSession` | `boolean` | active SSH session or not |
|
|
|
|
| `.Root` | `boolean` | are you a root/admin user or not |
|
2021-02-15 03:53:28 -08:00
|
|
|
|
2022-04-20 09:43:59 -07:00
|
|
|
[templates]: /docs/configuration/templates
|