mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -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",
|
||||
"trailing_diamond": "\uE0B0",
|
||||
"properties": {
|
||||
"template": "{{ .UserName }}"
|
||||
"template": "{{ if .SSHSession }}\uF817 {{ end }}{{ .UserName }}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 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
|
||||
properties below.
|
||||
|
||||
|
|
|
@ -254,6 +254,8 @@ const (
|
|||
DisplayUser Property = "display_user"
|
||||
// DefaultUserName holds the default user of the platform
|
||||
DefaultUserName Property = "default_user_name"
|
||||
// SSHIcon is the icon used for SSH sessions
|
||||
SSHIcon Property = "ssh_icon"
|
||||
|
||||
defaultUserEnvVar = "POSH_SESSION_DEFAULT_USER"
|
||||
)
|
||||
|
|
|
@ -12,14 +12,10 @@ type session struct {
|
|||
SSHSession bool
|
||||
Root bool
|
||||
|
||||
// Deprecated
|
||||
DefaultUserName string
|
||||
}
|
||||
|
||||
const (
|
||||
// SSHIcon is the icon used for SSH sessions
|
||||
SSHIcon Property = "ssh_icon"
|
||||
)
|
||||
|
||||
func (s *session) enabled() bool {
|
||||
s.SSHSession = s.activeSSHSession()
|
||||
segmentTemplate := s.props.getString(SegmentTemplate, "")
|
||||
|
|
Loading…
Reference in a new issue