Back to Oh My Posh

Session

website/docs/segments/system/session.mdx

29.12.0975 B
Original Source

What

Show the current user and host name.

Sample Configuration

import Config from '@site/src/components/Config.js';

<Config data={{ "type": "session", "style": "diamond", "foreground": "#ffffff", "background": "#c386f1", "leading_diamond": "\uE0B6", "trailing_diamond": "\uE0B0", "template": "{{ if .SSHSession }}\ueba9 {{ end }}{{ .UserName }}" }}/>

Template (info)

:::note default template

template
 {{ if .SSHSession }}\ueba9 {{ end }}{{ .UserName }}@{{ .HostName }}

:::

Properties

NameTypeDescription
.UserNamestringthe current user's name
.HostNamestringthe current computer's name
.SSHSessionbooleanactive SSH session or not
.Rootbooleanare you a root/admin user or not