mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
refactor(session): deprecate ssh_icon
This commit is contained in:
parent
f3f2985543
commit
39a27b29ad
|
@ -19,15 +19,13 @@ Show the current user and host name.
|
||||||
"leading_diamond": "\uE0B6",
|
"leading_diamond": "\uE0B6",
|
||||||
"trailing_diamond": "\uE0B0",
|
"trailing_diamond": "\uE0B0",
|
||||||
"properties": {
|
"properties": {
|
||||||
"template": "{{ .UserName }}"
|
"template": "{{ if .SSHSession }}\uF817 {{ end }}{{ .UserName }}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
- ssh_icon: `string` - text/icon to display first when in an active SSH session - defaults
|
|
||||||
to `\uF817 `
|
|
||||||
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
properties below.
|
properties below.
|
||||||
|
|
||||||
|
|
|
@ -254,6 +254,8 @@ const (
|
||||||
DisplayUser Property = "display_user"
|
DisplayUser Property = "display_user"
|
||||||
// DefaultUserName holds the default user of the platform
|
// DefaultUserName holds the default user of the platform
|
||||||
DefaultUserName Property = "default_user_name"
|
DefaultUserName Property = "default_user_name"
|
||||||
|
// SSHIcon is the icon used for SSH sessions
|
||||||
|
SSHIcon Property = "ssh_icon"
|
||||||
|
|
||||||
defaultUserEnvVar = "POSH_SESSION_DEFAULT_USER"
|
defaultUserEnvVar = "POSH_SESSION_DEFAULT_USER"
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,14 +12,10 @@ type session struct {
|
||||||
SSHSession bool
|
SSHSession bool
|
||||||
Root bool
|
Root bool
|
||||||
|
|
||||||
|
// Deprecated
|
||||||
DefaultUserName string
|
DefaultUserName string
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
// SSHIcon is the icon used for SSH sessions
|
|
||||||
SSHIcon Property = "ssh_icon"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (s *session) enabled() bool {
|
func (s *session) enabled() bool {
|
||||||
s.SSHSession = s.activeSSHSession()
|
s.SSHSession = s.activeSSHSession()
|
||||||
segmentTemplate := s.props.getString(SegmentTemplate, "")
|
segmentTemplate := s.props.getString(SegmentTemplate, "")
|
||||||
|
|
Loading…
Reference in a new issue