mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-08 17:57:26 -08:00
853eaa3890
relates to #376
47 lines
1.5 KiB
Markdown
47 lines
1.5 KiB
Markdown
---
|
|
id: session
|
|
title: Session
|
|
sidebar_label: Session
|
|
---
|
|
|
|
## What
|
|
|
|
Show the current user and host name.
|
|
|
|
## Sample Configuration
|
|
|
|
```json
|
|
{
|
|
"type": "session",
|
|
"style": "diamond",
|
|
"foreground": "#ffffff",
|
|
"background": "#c386f1",
|
|
"leading_diamond": "\uE0B6",
|
|
"trailing_diamond": "\uE0B0"
|
|
}
|
|
```
|
|
|
|
## Properties
|
|
|
|
- user_info_separator: `string` - text/icon to put in between the user and host name - defaults to `@`
|
|
- ssh_icon: `string` - text/icon to display first when in an active SSH session - defaults
|
|
to `\uF817 `
|
|
- user_color: `string` [color][colors] - override the foreground color of the user name
|
|
- host_color: `string` [color][colors] - override the foreground color of the host name
|
|
- display_user: `boolean` - display the user name or not - defaults to `true`
|
|
- display_host: `boolean` - display the host name or not - defaults to `true`
|
|
- default_user_name: `string` - name of the default user - defaults to empty
|
|
- display_default_user: `boolean` - display the segment or not when the user matches `default_user_name` - defaults
|
|
to `true`
|
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
|
properties below. Only used when a value is set, making the above properties obsolete.
|
|
|
|
## Template Properties
|
|
|
|
- `.UserName`: `string` - the current user's name
|
|
- `.ComputerName`: `string` - the current computer's name
|
|
- `.SSHSession`: `boolean` - active SSH session or not
|
|
- `.Root`: `boolean` - are you a root/admin user or not
|
|
|
|
[colors]: /docs/configure#colors
|