diff --git a/src/engine/segment.go b/src/engine/segment.go index 523605af..362a2da7 100644 --- a/src/engine/segment.go +++ b/src/engine/segment.go @@ -12,6 +12,9 @@ import ( "oh-my-posh/segments" "oh-my-posh/shell" "oh-my-posh/template" + + c "golang.org/x/text/cases" + "golang.org/x/text/language" ) // Segment represent a single segment and it's configuration @@ -397,7 +400,7 @@ func (segment *Segment) SetEnabled(env platform.Environment) { segment.Enabled = true name := segment.Alias if len(name) == 0 { - name = string(segment.Type) + name = c.Title(language.English).String(string(segment.Type)) } env.TemplateCache().AddSegmentData(name, segment.writer) } diff --git a/src/platform/shell.go b/src/platform/shell.go index afb480ab..849d893b 100644 --- a/src/platform/shell.go +++ b/src/platform/shell.go @@ -24,8 +24,6 @@ import ( "time" process "github.com/shirou/gopsutil/v3/process" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) const ( @@ -158,7 +156,6 @@ func (t *TemplateCache) AddSegmentData(key string, value interface{}) { if t.Segments == nil { t.Segments = make(map[string]interface{}) } - key = cases.Title(language.English).String(key) t.Segments[key] = value }