diff --git a/src/config/config.go b/src/config/config.go index 5facc537..f6650350 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -17,7 +17,7 @@ const ( AUTOUPGRADE = "autoupgrade" UPGRADENOTICE = "upgradenotice" - Version = 2 + Version = 3 ) // Config holds all the theme for rendering the prompt diff --git a/src/config/default.go b/src/config/default.go index 457e39b9..3abee94a 100644 --- a/src/config/default.go +++ b/src/config/default.go @@ -10,12 +10,14 @@ import ( func Default(env runtime.Environment, warning bool) *Config { exitBackgroundTemplate := "{{ if gt .Code 0 }}p:red{{ end }}" exitTemplate := " {{ if gt .Code 0 }}\uf00d{{ else }}\uf00c{{ end }} " + if warning { exitBackgroundTemplate = "p:red" exitTemplate = " CONFIG ERROR " } + cfg := &Config{ - Version: 2, + Version: 3, FinalSpace: true, Blocks: []*Block{ { @@ -194,6 +196,7 @@ func Default(env runtime.Environment, warning bool) *Config { }, }, } + cfg.env = env return cfg } diff --git a/src/config/migrate.go b/src/config/migrate.go index b07441f2..18deffef 100644 --- a/src/config/migrate.go +++ b/src/config/migrate.go @@ -1,277 +1,33 @@ package config import ( - "fmt" - "strings" - - "github.com/jandedobbeleer/oh-my-posh/src/properties" - "github.com/jandedobbeleer/oh-my-posh/src/runtime" - "github.com/jandedobbeleer/oh-my-posh/src/segments" -) - -const ( - colorBackground = properties.Property("color_background") - - prefix = properties.Property("prefix") - postfix = properties.Property("postfix") - segmentTemplate = properties.Property("template") + "github.com/jandedobbeleer/oh-my-posh/src/cache" ) func (cfg *Config) Migrate() { for _, block := range cfg.Blocks { for _, segment := range block.Segments { - segment.migrate(cfg.env, cfg.Version) + segment.migrate(cfg.Version) } } - for _, segment := range cfg.Tooltips { - segment.migrate(cfg.env, cfg.Version) - } - if strings.Contains(cfg.ConsoleTitleTemplate, ".Path") { - cfg.ConsoleTitleTemplate = strings.ReplaceAll(cfg.ConsoleTitleTemplate, ".Path", ".PWD") - } + cfg.updated = true cfg.Version = Version } -func (segment *Segment) migrate(env runtime.Environment, version int) { - if version < 1 { - segment.migrationOne(env) +func (segment *Segment) migrate(version int) { + // configs older than 2 are no longer supported + if version != 2 { + return } - if version < 2 { - segment.migrationTwo(env) - } -} -func (segment *Segment) migrationOne(env runtime.Environment) { - if err := segment.MapSegmentWithWriter(env); err != nil { - return + // Cache settings + delete(segment.Properties, "cache_version") + cacheTimeout := segment.Properties.GetInt("cache_timeout", 0) + if cacheTimeout != 0 { + segment.Cache = &cache.Config{ + Duration: cache.ToDuration(cacheTimeout * 60), + Strategy: cache.Folder, + } } - // General properties that need replacement - segment.migratePropertyKey("display_version", properties.FetchVersion) - delete(segment.Properties, "enable_hyperlink") - switch segment.Type { //nolint:exhaustive - case TEXT: - segment.migratePropertyKey("text", segmentTemplate) - segment.migrateTemplate() - case GIT: - hasTemplate := segment.hasProperty(segmentTemplate) - segment.migratePropertyKey("display_status", segments.FetchStatus) - segment.migratePropertyKey("display_stash_count", segments.FetchStashCount) - segment.migratePropertyKey("display_worktree_count", segments.FetchWorktreeCount) - segment.migratePropertyKey("display_upstream_icon", segments.FetchUpstreamIcon) - segment.migrateTemplate() - segment.migrateIconOverride("local_working_icon", " \uF044 ") - segment.migrateIconOverride("local_staged_icon", " \uF046 ") - segment.migrateIconOverride("stash_count_icon", " \uf0c7 ") - segment.migrateIconOverride("worktree_count_icon", " \uf1bb ") - segment.migrateIconOverride("status_separator_icon", " |") - if segment.Properties.GetBool("status_colors_enabled", false) { - background := segment.Properties.GetBool(colorBackground, true) - segment.migrateColorOverride("local_changes_color", "{{ if or (.Working.Changed) (.Staging.Changed) }}%s{{ end }}", background) - segment.migrateColorOverride("ahead_and_behind_color", "{{ if and (gt .Ahead 0) (gt .Behind 0) }}%s{{ end }}", background) - segment.migrateColorOverride("behind_color", "{{ if gt .Ahead 0 }}%s{{ end }}", background) - segment.migrateColorOverride("ahead_color", "{{ if gt .Behind 0 }}%s{{ end }}", background) - } - if !hasTemplate { - segment.migrateInlineColorOverride("working_color", "{{ .Working.String }}") - segment.migrateInlineColorOverride("staging_color", "{{ .Staging.String }}") - } - // legacy properties - delete(segment.Properties, "display_branch_status") - delete(segment.Properties, "display_status_detail") - delete(segment.Properties, "status_colors_enabled") - case BATTERY: - segment.migrateTemplate() - background := segment.Properties.GetBool(colorBackground, false) - segment.migrateColorOverride("charged_color", `{{ if eq "Full" .State.String }}%s{{ end }}`, background) - segment.migrateColorOverride("charging_color", `{{ if eq "Charging" .State.String }}%s{{ end }}`, background) - segment.migrateColorOverride("discharging_color", `{{ if eq "Discharging" .State.String }}%s{{ end }}`, background) - stateList := []string{`"Discharging"`} - if segment.Properties.GetBool("display_charging", true) { - stateList = append(stateList, `"Charging"`) - } - if segment.Properties.GetBool("display_charged", true) { - stateList = append(stateList, `"Full"`) - } - if len(stateList) < 3 { - enabledTemplate := "{{ $stateList := list %s }}{{ if has .State.String $stateList }}{{ .Icon }}{{ .Percentage }}{{ end }}" - template := segment.Properties.GetString(segmentTemplate, segment.writer.Template()) - template = strings.ReplaceAll(template, "{{ .Icon }}{{ .Percentage }}", fmt.Sprintf(enabledTemplate, strings.Join(stateList, " "))) - segment.Properties[segmentTemplate] = template - } - // legacy properties - delete(segment.Properties, "display_charging") - delete(segment.Properties, "display_charged") - delete(segment.Properties, "battery_icon") - case PYTHON: - segment.migrateTemplate() - segment.migratePropertyKey("display_virtual_env", segments.FetchVirtualEnv) - case SESSION: - hasTemplate := segment.hasProperty(segmentTemplate) - segment.migrateTemplate() - segment.migrateIconOverride("ssh_icon", "\ueba9 ") - template := segment.Properties.GetString(segmentTemplate, segment.writer.Template()) - template = strings.ReplaceAll(template, ".ComputerName", ".HostName") - if !segment.Properties.GetBool("display_host", true) { - template = strings.ReplaceAll(template, "@{{ .HostName }}", "") - } - if !segment.Properties.GetBool("display_user", true) { - template = strings.ReplaceAll(template, "@", "") - template = strings.ReplaceAll(template, "{{ .UserName }}", "") - } - segment.Properties[segmentTemplate] = template - segment.migrateIconOverride("user_info_separator", "@") - if !hasTemplate { - segment.migrateInlineColorOverride("user_color", "{{ .UserName }}") - segment.migrateInlineColorOverride("host_color", "{{ .HostName }}") - } - case NODE: - segment.migrateTemplate() - segment.migratePropertyKey("display_package_manager", segments.FetchPackageManager) - enableVersionMismatch := "enable_version_mismatch" - if segment.Properties.GetBool(properties.Property(enableVersionMismatch), false) { - delete(segment.Properties, properties.Property(enableVersionMismatch)) - background := segment.Properties.GetBool(colorBackground, false) - segment.migrateColorOverride("version_mismatch_color", "{{ if .Mismatch }}%s{{ end }}", background) - } - case EXIT: - template := segment.Properties.GetString(segmentTemplate, "{{ if gt .Code 0 }}\uf00d {{ .Meaning }}{{ else }}\uf42e{{ end }}") - if strings.Contains(template, ".Text") { - template = strings.ReplaceAll(template, ".Text", ".Meaning") - segment.Properties[segmentTemplate] = template - } - displayExitCode := properties.Property("display_exit_code") - if !segment.Properties.GetBool(displayExitCode, true) { - delete(segment.Properties, displayExitCode) - template = strings.ReplaceAll(template, " {{ .Meaning }}", "") - } - alwaysNumeric := properties.Property("always_numeric") - if segment.Properties.GetBool(alwaysNumeric, false) { - delete(segment.Properties, alwaysNumeric) - template = strings.ReplaceAll(template, ".Meaning", ".Code") - } - segment.Properties[segmentTemplate] = template - segment.migrateTemplate() - segment.migrateIconOverride("success_icon", "\uf42e") - segment.migrateIconOverride("error_icon", "\uf00d") - background := segment.Properties.GetBool(colorBackground, false) - segment.migrateColorOverride("error_color", "{{ if gt .Code 0 }}%s{{ end }}", background) - default: - segment.migrateTemplate() - } - delete(segment.Properties, colorBackground) -} - -func (segment *Segment) migrationTwo(env runtime.Environment) { - if err := segment.MapSegmentWithWriter(env); err != nil { - return - } - if !segment.hasProperty(segmentTemplate) { - return - } - template := segment.Properties.GetString(segmentTemplate, segment.writer.Template()) - segment.Template = template - delete(segment.Properties, segmentTemplate) -} - -func (segment *Segment) hasProperty(property properties.Property) bool { - for key := range segment.Properties { - if key == property { - return true - } - } - return false -} - -func (segment *Segment) migratePropertyValue(property properties.Property, value any) { - if !segment.hasProperty(property) { - return - } - segment.Properties[property] = value -} - -func (segment *Segment) migratePropertyKey(oldProperty, newProperty properties.Property) { - if !segment.hasProperty(oldProperty) { - return - } - value := segment.Properties[oldProperty] - delete(segment.Properties, oldProperty) - segment.Properties[newProperty] = value -} - -func (segment *Segment) migrateTemplate() { - defer segment.migratePreAndPostFix() - if segment.hasProperty(segmentTemplate) { - // existing template, ensure to add default pre/postfix values - if !segment.hasProperty(prefix) { - segment.Properties[prefix] = " " - } - if !segment.hasProperty(postfix) { - segment.Properties[postfix] = " " - } - return - } - segment.Properties[segmentTemplate] = segment.writer.Template() -} - -func (segment *Segment) migrateIconOverride(property properties.Property, overrideValue string) { - if !segment.hasProperty(property) { - return - } - template := segment.Properties.GetString(segmentTemplate, segment.writer.Template()) - if strings.Contains(template, overrideValue) { - template = strings.ReplaceAll(template, overrideValue, segment.Properties.GetString(property, "")) - } - segment.Properties[segmentTemplate] = template - delete(segment.Properties, property) -} - -func (segment *Segment) migrateColorOverride(property properties.Property, template string, background bool) { - if !segment.hasProperty(property) { - return - } - color := segment.Properties.GetColor(property, "") - delete(segment.Properties, property) - if len(color) == 0 { - return - } - colorTemplate := fmt.Sprintf(template, color) - if background { - segment.BackgroundTemplates = append(segment.BackgroundTemplates, colorTemplate) - return - } - segment.ForegroundTemplates = append(segment.ForegroundTemplates, colorTemplate) -} - -func (segment *Segment) migrateInlineColorOverride(property properties.Property, old string) { - if !segment.hasProperty(property) { - return - } - color := segment.Properties.GetColor(property, "") - delete(segment.Properties, property) - if len(color) == 0 { - return - } - colorTemplate := fmt.Sprintf("<%s>%s", color, old) - template := segment.Properties.GetString(segmentTemplate, segment.writer.Template()) - template = strings.ReplaceAll(template, old, colorTemplate) - segment.Properties[segmentTemplate] = template -} - -func (segment *Segment) migratePreAndPostFix() { - template := segment.Properties.GetString(segmentTemplate, segment.writer.Template()) - defaultValue := " " - if segment.hasProperty(prefix) { - prefix := segment.Properties.GetString(prefix, defaultValue) - template = strings.TrimPrefix(template, defaultValue) - template = prefix + template - delete(segment.Properties, "prefix") - } - if segment.hasProperty(postfix) { - postfix := segment.Properties.GetString(postfix, defaultValue) - template = strings.TrimSuffix(template, defaultValue) - template += postfix - delete(segment.Properties, "postfix") - } - segment.Properties[segmentTemplate] = template } diff --git a/src/config/migrate_test.go b/src/config/migrate_test.go deleted file mode 100644 index dc6bfffe..00000000 --- a/src/config/migrate_test.go +++ /dev/null @@ -1,481 +0,0 @@ -package config - -import ( - "testing" - - "github.com/jandedobbeleer/oh-my-posh/src/properties" - "github.com/jandedobbeleer/oh-my-posh/src/runtime" - "github.com/jandedobbeleer/oh-my-posh/src/runtime/mock" - "github.com/jandedobbeleer/oh-my-posh/src/segments" - - "github.com/stretchr/testify/assert" - testify_ "github.com/stretchr/testify/mock" -) - -const ( - Foo = "foo" - Bar = "bar" - FooBar = "foobar" -) - -func TestHasProperty(t *testing.T) { - cases := []struct { - Props properties.Map - Case string - Property properties.Property - Expected bool - }{ - {Case: "Match", Expected: true, Property: Foo, Props: properties.Map{Foo: "bar"}}, - {Case: "No Match", Expected: false, Property: Foo, Props: properties.Map{Bar: "foo"}}, - {Case: "No properties", Expected: false}, - } - for _, tc := range cases { - segment := &Segment{ - Properties: tc.Props, - } - got := segment.hasProperty(tc.Property) - assert.Equal(t, tc.Expected, got, tc.Case) - } -} - -func TestMigratePropertyValue(t *testing.T) { - cases := []struct { - Expected any - Props properties.Map - Case string - Property properties.Property - }{ - {Case: "Match", Expected: "foo", Property: Foo, Props: properties.Map{Foo: "bar"}}, - {Case: "No Match", Expected: nil, Property: Foo, Props: properties.Map{Bar: "foo"}}, - } - for _, tc := range cases { - segment := &Segment{ - Properties: tc.Props, - } - segment.migratePropertyValue(tc.Property, tc.Expected) - assert.Equal(t, tc.Expected, segment.Properties[tc.Property], tc.Case) - } -} - -func TestMigratePropertyKey(t *testing.T) { - cases := []struct { - Expected any - Props properties.Map - Case string - OldProperty properties.Property - NewProperty properties.Property - }{ - {Case: "Match", Expected: "bar", OldProperty: Foo, NewProperty: Bar, Props: properties.Map{Foo: "bar"}}, - {Case: "No match", Expected: nil, OldProperty: Foo, NewProperty: Bar, Props: properties.Map{FooBar: "bar"}}, - {Case: "No migration", Expected: "bar", OldProperty: Foo, NewProperty: Bar, Props: properties.Map{Bar: "bar"}}, - } - for _, tc := range cases { - segment := &Segment{ - Properties: tc.Props, - } - segment.migratePropertyKey(tc.OldProperty, tc.NewProperty) - assert.Equal(t, tc.Expected, segment.Properties[tc.NewProperty], tc.Case) - assert.NotContains(t, segment.Properties, tc.OldProperty, tc.Case) - } -} - -type MockedWriter struct { - template string - text string -} - -func (m *MockedWriter) Enabled() bool { - return true -} - -func (m *MockedWriter) Template() string { - return m.template -} - -func (m *MockedWriter) Text() string { - return m.text -} - -func (m *MockedWriter) SetText(text string) { - m.text = text -} - -func (m *MockedWriter) Init(_ properties.Properties, _ runtime.Environment) {} - -func TestIconOverride(t *testing.T) { - cases := []struct { - Props properties.Map - Case string - Expected string - Property properties.Property - }{ - { - Case: "Match", - Expected: "hello bar bar", - Property: Foo, - Props: properties.Map{ - Foo: " bar ", - segmentTemplate: "hello foo bar", - }, - }, - { - Case: "No match", - Expected: "hello foo bar", - Property: Foo, - Props: properties.Map{ - Bar: " bar ", - segmentTemplate: "hello foo bar", - }, - }, - } - for _, tc := range cases { - segment := &Segment{ - Properties: tc.Props, - writer: &MockedWriter{ - template: tc.Props.GetString(segmentTemplate, ""), - }, - } - segment.migrateIconOverride(tc.Property, " foo ") - assert.Equal(t, tc.Expected, segment.Properties[segmentTemplate], tc.Case) - } -} - -func TestColorMigration(t *testing.T) { - cases := []struct { - Props properties.Map - Case string - Expected string - Property properties.Property - Template string - Background bool - NoOverride bool - }{ - { - Case: "Foreground override", - Expected: "hello green bar", - Template: "hello %s bar", - Property: Foo, - Props: properties.Map{ - Foo: "green", - }, - }, - { - Case: "Background override", - Expected: "hello green bar", - Template: "hello %s bar", - Property: Foo, - Background: true, - Props: properties.Map{ - Foo: "green", - }, - }, - { - Case: "No override", - Expected: "hello green bar", - Template: "hello %s bar", - Property: Foo, - NoOverride: true, - }, - } - for _, tc := range cases { - segment := &Segment{ - Properties: tc.Props, - } - if tc.Background { - segment.Properties[colorBackground] = true - } - segment.migrateColorOverride(tc.Property, tc.Template, tc.Background) - templates := segment.ForegroundTemplates - if tc.Background { - templates = segment.BackgroundTemplates - } - if tc.NoOverride { - assert.Empty(t, templates, tc.Case) - return - } - lastElement := templates[len(templates)-1] - assert.Equal(t, tc.Expected, lastElement, tc.Case) - } -} - -func TestSegmentTemplateMigration(t *testing.T) { - cases := []struct { - Props properties.Map - Case string - Expected string - Type SegmentType - }{ - { - Case: "GIT", - Expected: " {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} working {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} and{{ end }}{{ if .Staging.Changed }} staged {{ .Staging.String }}{{ end }} ", //nolint: lll - Type: GIT, - Props: properties.Map{ - "local_working_icon": " working ", - "local_staged_icon": " staged ", - "worktree_count_icon": " worktree ", - "stash_count_icon": " stash ", - "status_separator_icon": " and", - }, - }, - { - Case: "GIT - Staging and Working Color", - Expected: " {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} working <#123456>{{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} and{{ end }}{{ if .Staging.Changed }} staged <#123456>{{ .Staging.String }}{{ end }} ", //nolint: lll - Type: GIT, - Props: properties.Map{ - "local_working_icon": " working ", - "local_staged_icon": " staged ", - "worktree_count_icon": " worktree ", - "stash_count_icon": " stash ", - "status_separator_icon": " and", - "working_color": "#123456", - "staging_color": "#123456", - }, - }, - { - Case: "EXIT - No exit code", - Expected: " {{ if gt .Code 0 }}FAIL{{ else }}SUCCESS{{ end }} ", - Type: EXIT, - Props: properties.Map{ - "display_exit_code": false, - "success_icon": "SUCCESS", - "error_icon": "FAIL", - }, - }, - { - Case: "EXIT - No spaces", - Expected: "{{ if gt .Code 0 }}💩{{ else }}🌵{{ end }}", - Type: EXIT, - Props: properties.Map{ - "prefix": "", - "postfix": "", - "display_exit_code": false, - "always_enabled": true, - "success_icon": "🌵", - "error_icon": "💩", - }, - }, - { - Case: "EXIT - Always numeric", - Expected: " {{ if gt .Code 0 }}FAIL {{ .Code }}{{ else }}SUCCESS{{ end }} ", - Type: EXIT, - Props: properties.Map{ - "always_numeric": true, - "success_icon": "SUCCESS", - "error_icon": "FAIL", - }, - }, - { - Case: "EXIT - .Text", - Expected: " {{ .Meaning }} ", - Type: EXIT, - Props: properties.Map{ - "template": "{{ .Text }}", - }, - }, - { - Case: "BATTERY", - Expected: ` {{ if not .Error }}{{ $stateList := list "Discharging" "Full" }}{{ if has .State.String $stateList }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ end }}{{ .Error }} `, - Type: BATTERY, - Props: properties.Map{ - "display_charging": false, - }, - }, - { - Case: "SESSION", - Expected: " {{ if .SSHSession }}SSH {{ end }}{{ .UserName }}@{{ .HostName }} ", - Type: SESSION, - Props: properties.Map{ - "ssh_icon": "SSH ", - }, - }, - { - Case: "SESSION no HOST", - Expected: " {{ if .SSHSession }}\ueba9 {{ end }}{{ .UserName }} ", - Type: SESSION, - Props: properties.Map{ - "display_host": false, - }, - }, - { - Case: "SESSION no USER", - Expected: " {{ if .SSHSession }}\ueba9 {{ end }}{{ .HostName }} ", - Type: SESSION, - Props: properties.Map{ - "display_user": false, - }, - }, - { - Case: "SESSION no USER nor HOST", - Expected: " {{ if .SSHSession }}\ueba9 {{ end }} ", - Type: SESSION, - Props: properties.Map{ - "display_user": false, - "display_host": false, - }, - }, - { - Case: "SESSION - Color overrides", - Expected: " {{ if .SSHSession }}\ueba9 {{ end }}<#123456>{{ .UserName }}@<#789012>{{ .HostName }} ", - Type: SESSION, - Props: properties.Map{ - "user_color": "#123456", - "host_color": "#789012", - }, - }, - { - Case: "SESSION - Existing template", - Expected: " {{ .UserName }}@{{ .HostName }} ", - Type: SESSION, - Props: properties.Map{ - "template": "{{ .UserName }}@{{ .ComputerName }}", - }, - }, - } - for _, tc := range cases { - segment := &Segment{ - Type: tc.Type, - Properties: tc.Props, - } - env := &mock.Environment{} - env.On("Debug", testify_.Anything).Return(nil) - segment.migrationOne(env) - assert.Equal(t, tc.Expected, segment.Properties[segmentTemplate], tc.Case) - } -} - -func TestInlineColorOverride(t *testing.T) { - cases := []struct { - Props properties.Map - Case string - Expected string - Property properties.Property - }{ - { - Case: "Match", - Expected: "hello <#123456>foo bar", - Property: Foo, - Props: properties.Map{ - Foo: "#123456", - segmentTemplate: "hello foo bar", - }, - }, - { - Case: "No match", - Expected: "hello foo bar", - Property: Foo, - Props: properties.Map{ - Bar: "#123456", - segmentTemplate: "hello foo bar", - }, - }, - } - for _, tc := range cases { - segment := &Segment{ - Properties: tc.Props, - writer: &MockedWriter{ - template: tc.Props.GetString(segmentTemplate, ""), - }, - } - segment.migrateInlineColorOverride(tc.Property, "foo") - assert.Equal(t, tc.Expected, segment.Properties[segmentTemplate], tc.Case) - } -} - -func TestMigratePreAndPostfix(t *testing.T) { - cases := []struct { - Props properties.Map - Case string - Expected string - }{ - { - Case: "Pre and Postfix", - Expected: "\ue0b6 \uf489 {{ .Name }} \ue0b2", - Props: properties.Map{ - "postfix": " \ue0b2", - "prefix": "\ue0b6 \uf489 ", - "template": "{{ .Name }}", - }, - }, - { - Case: "Prefix", - Expected: segments.NameTemplate, - Props: properties.Map{ - "prefix": " ", - "template": "{{ .Name }}", - }, - }, - { - Case: "Postfix", - Expected: segments.NameTemplate, - Props: properties.Map{ - "postfix": " ", - "template": "{{ .Name }} ", - }, - }, - } - for _, tc := range cases { - segment := &Segment{ - Properties: tc.Props, - writer: &MockedWriter{ - template: tc.Props.GetString(segmentTemplate, ""), - }, - } - segment.migrateTemplate() - assert.Equal(t, tc.Expected, segment.Properties[segmentTemplate], tc.Case) - assert.NotContains(t, segment.Properties, "prefix", tc.Case) - assert.NotContains(t, segment.Properties, "postfix", tc.Case) - } -} - -func TestMigrateConfig(t *testing.T) { - cases := []struct { - Case string - Expected string - Template string - }{ - {Case: "Path", Expected: "{{ .PWD }}", Template: "{{ .Path }}"}, - {Case: "No Path", Expected: "foo", Template: "foo"}, - {Case: "Empty", Expected: "", Template: ""}, - } - for _, tc := range cases { - cfg := &Config{ - ConsoleTitleTemplate: tc.Template, - env: &mock.Environment{}, - } - cfg.Migrate() - assert.Equal(t, tc.Expected, cfg.ConsoleTitleTemplate, tc.Case) - } -} - -func TestMigrationTwo(t *testing.T) { - cases := []struct { - Case string - Expected string - Template string - }{ - { - Case: "With template", - Expected: "{{ .Name }}", - Template: "{{ .Name }}", - }, - { - Case: "No template", - Expected: "", - }, - } - for _, tc := range cases { - segment := &Segment{ - Type: SESSION, - Properties: properties.Map{}, - writer: &MockedWriter{ - template: tc.Template, - }, - } - if tc.Template != "" { - segment.Properties[segmentTemplate] = tc.Template - } - segment.migrationTwo(&mock.Environment{}) - assert.Equal(t, tc.Expected, segment.Template, tc.Case) - assert.NotContains(t, segment.Properties, segmentTemplate, tc.Case) - } -} diff --git a/src/config/segment.go b/src/config/segment.go index 05e6c870..c8fbf5f6 100644 --- a/src/config/segment.go +++ b/src/config/segment.go @@ -36,13 +36,12 @@ func (s *SegmentStyle) resolve(context any) SegmentStyle { } type Segment struct { - writer SegmentWriter - env runtime.Environment - + writer SegmentWriter + env runtime.Environment Properties properties.Map `json:"properties,omitempty" toml:"properties,omitempty"` Cache *cache.Config `json:"cache,omitempty" toml:"cache,omitempty"` - Filler string `json:"filler,omitempty" toml:"filler,omitempty"` - styleCache SegmentStyle + Alias string `json:"alias,omitempty" toml:"alias,omitempty"` + LeadingPowerlineSymbol string `json:"leading_powerline_symbol,omitempty" toml:"leading_powerline_symbol,omitempty"` name string LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty"` TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty"` @@ -51,21 +50,22 @@ type Segment struct { TemplatesLogic template.Logic `json:"templates_logic,omitempty" toml:"templates_logic,omitempty"` PowerlineSymbol string `json:"powerline_symbol,omitempty" toml:"powerline_symbol,omitempty"` Background color.Ansi `json:"background" toml:"background"` - Alias string `json:"alias,omitempty" toml:"alias,omitempty"` + Filler string `json:"filler,omitempty" toml:"filler,omitempty"` Type SegmentType `json:"type,omitempty" toml:"type,omitempty"` Style SegmentStyle `json:"style,omitempty" toml:"style,omitempty"` - LeadingPowerlineSymbol string `json:"leading_powerline_symbol,omitempty" toml:"leading_powerline_symbol,omitempty"` - ForegroundTemplates template.List `json:"foreground_templates,omitempty" toml:"foreground_templates,omitempty"` - Tips []string `json:"tips,omitempty" toml:"tips,omitempty"` - BackgroundTemplates template.List `json:"background_templates,omitempty" toml:"background_templates,omitempty"` - MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty"` - MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty"` - Duration time.Duration `json:"-" toml:"-"` - NameLength int `json:"-" toml:"-"` - Interactive bool `json:"interactive,omitempty" toml:"interactive,omitempty"` - Enabled bool `json:"-" toml:"-"` - Newline bool `json:"newline,omitempty" toml:"newline,omitempty"` - InvertPowerline bool `json:"invert_powerline,omitempty" toml:"invert_powerline,omitempty"` + styleCache SegmentStyle + ForegroundTemplates template.List `json:"foreground_templates,omitempty" toml:"foreground_templates,omitempty"` + Tips []string `json:"tips,omitempty" toml:"tips,omitempty"` + BackgroundTemplates template.List `json:"background_templates,omitempty" toml:"background_templates,omitempty"` + Templates template.List `json:"templates,omitempty" toml:"templates,omitempty"` + MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty"` + MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty"` + Duration time.Duration `json:"-" toml:"-"` + NameLength int `json:"-" toml:"-"` + Interactive bool `json:"interactive,omitempty" toml:"interactive,omitempty"` + Enabled bool `json:"-" toml:"-"` + Newline bool `json:"newline,omitempty" toml:"newline,omitempty"` + InvertPowerline bool `json:"invert_powerline,omitempty" toml:"invert_powerline,omitempty"` } func (segment *Segment) Name() string { @@ -112,6 +112,10 @@ func (segment *Segment) Execute(env runtime.Environment) { return } + if len(segment.Templates) != 0 { + segment.Template = strings.Join(segment.Templates, "") + } + if segment.writer.Enabled() { segment.Enabled = true env.TemplateCache().AddSegmentData(segment.Name(), segment.writer) diff --git a/src/test/jandedobbeleer-palette.omp.json b/src/test/jandedobbeleer-palette.omp.json index 85f4f471..2c911a3a 100644 --- a/src/test/jandedobbeleer-palette.omp.json +++ b/src/test/jandedobbeleer-palette.omp.json @@ -254,5 +254,5 @@ "white": "#FFFFFF", "ytm": "#1BD760" }, - "version": 2 + "version": 3 } diff --git a/src/test/jandedobbeleer.omp.json b/src/test/jandedobbeleer.omp.json index ea40d4ac..885df857 100644 --- a/src/test/jandedobbeleer.omp.json +++ b/src/test/jandedobbeleer.omp.json @@ -223,5 +223,5 @@ ], "console_title_template": "{{ .Shell }} in {{ .Folder }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/1_shell.omp.json b/themes/1_shell.omp.json index 0fbc0a27..dabeaa0f 100644 --- a/themes/1_shell.omp.json +++ b/themes/1_shell.omp.json @@ -113,5 +113,5 @@ "foreground": "#FEF5ED", "template": "\ue285 " }, - "version": 2 + "version": 3 } diff --git a/themes/M365Princess.omp.json b/themes/M365Princess.omp.json index 12bb380c..6e662659 100644 --- a/themes/M365Princess.omp.json +++ b/themes/M365Princess.omp.json @@ -101,5 +101,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/agnoster.minimal.omp.json b/themes/agnoster.minimal.omp.json index 8badc525..95932ec4 100644 --- a/themes/agnoster.minimal.omp.json +++ b/themes/agnoster.minimal.omp.json @@ -61,5 +61,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/agnoster.omp.json b/themes/agnoster.omp.json index 4d88e6c0..b274d7f4 100644 --- a/themes/agnoster.omp.json +++ b/themes/agnoster.omp.json @@ -63,5 +63,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/agnosterplus.omp.json b/themes/agnosterplus.omp.json index a19478d4..d18527c9 100644 --- a/themes/agnosterplus.omp.json +++ b/themes/agnosterplus.omp.json @@ -53,5 +53,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/aliens.omp.json b/themes/aliens.omp.json index 760376ae..ca4c12aa 100644 --- a/themes/aliens.omp.json +++ b/themes/aliens.omp.json @@ -46,5 +46,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/amro.omp.json b/themes/amro.omp.json index a475aa43..3afd1c7b 100644 --- a/themes/amro.omp.json +++ b/themes/amro.omp.json @@ -54,5 +54,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/atomic.omp.json b/themes/atomic.omp.json index 16e042c7..1c810631 100644 --- a/themes/atomic.omp.json +++ b/themes/atomic.omp.json @@ -273,5 +273,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/atomicBit.omp.json b/themes/atomicBit.omp.json index 2a06465c..893de3d2 100644 --- a/themes/atomicBit.omp.json +++ b/themes/atomicBit.omp.json @@ -189,5 +189,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/avit.omp.json b/themes/avit.omp.json index b18099b0..d9cd6e56 100644 --- a/themes/avit.omp.json +++ b/themes/avit.omp.json @@ -49,5 +49,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/blue-owl.omp.json b/themes/blue-owl.omp.json index b5fd0ea4..db17b431 100644 --- a/themes/blue-owl.omp.json +++ b/themes/blue-owl.omp.json @@ -122,5 +122,5 @@ } ], "console_title_template": "{{if .Root}} \u26a1 {{end}}{{.Folder | replace \"~\" \"🏚\" }} @ {{.HostName}}", - "version": 2 + "version": 3 } diff --git a/themes/blueish.omp.json b/themes/blueish.omp.json index 7ce11199..b1d3c016 100644 --- a/themes/blueish.omp.json +++ b/themes/blueish.omp.json @@ -117,5 +117,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/bubbles.omp.json b/themes/bubbles.omp.json index f5a79c5f..76a44a79 100644 --- a/themes/bubbles.omp.json +++ b/themes/bubbles.omp.json @@ -162,5 +162,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/bubblesextra.omp.json b/themes/bubblesextra.omp.json index bc2e0713..4e6d0c12 100644 --- a/themes/bubblesextra.omp.json +++ b/themes/bubblesextra.omp.json @@ -174,5 +174,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/bubblesline.omp.json b/themes/bubblesline.omp.json index 59b92816..187e95f6 100644 --- a/themes/bubblesline.omp.json +++ b/themes/bubblesline.omp.json @@ -138,5 +138,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/capr4n.omp.json b/themes/capr4n.omp.json index f83864fa..7926528f 100644 --- a/themes/capr4n.omp.json +++ b/themes/capr4n.omp.json @@ -66,5 +66,5 @@ ], "console_title_template": "{{if .Root}} \u26a1 {{end}}{{.UserName}} \u2794 📁{{.Folder}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/catppuccin.omp.json b/themes/catppuccin.omp.json index e9998e14..7c32737e 100644 --- a/themes/catppuccin.omp.json +++ b/themes/catppuccin.omp.json @@ -67,5 +67,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/catppuccin_frappe.omp.json b/themes/catppuccin_frappe.omp.json index a0ce2eca..c4fa1c2c 100644 --- a/themes/catppuccin_frappe.omp.json +++ b/themes/catppuccin_frappe.omp.json @@ -63,6 +63,6 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/catppuccin_latte.omp.json b/themes/catppuccin_latte.omp.json index 5aac5d00..819856ed 100644 --- a/themes/catppuccin_latte.omp.json +++ b/themes/catppuccin_latte.omp.json @@ -63,6 +63,6 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/catppuccin_macchiato.omp.json b/themes/catppuccin_macchiato.omp.json index e43af5c2..619e4147 100644 --- a/themes/catppuccin_macchiato.omp.json +++ b/themes/catppuccin_macchiato.omp.json @@ -63,5 +63,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/catppuccin_mocha.omp.json b/themes/catppuccin_mocha.omp.json index b56ca001..1f82c5b1 100644 --- a/themes/catppuccin_mocha.omp.json +++ b/themes/catppuccin_mocha.omp.json @@ -63,5 +63,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/cert.omp.json b/themes/cert.omp.json index 8a873052..fa4b1fb5 100644 --- a/themes/cert.omp.json +++ b/themes/cert.omp.json @@ -54,5 +54,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/chips.omp.json b/themes/chips.omp.json index fe72ada0..4f9e00e9 100644 --- a/themes/chips.omp.json +++ b/themes/chips.omp.json @@ -82,13 +82,16 @@ "leading_diamond": "\uE0B6", "properties": { "url": "https://wakatime.com/api/v1/users/current/summaries?start=today&end=today&api_key={{ .Env.WAKATIME_API_KEY }}", - "http_timeout": 2000, - "cache_timeout": 5 + "http_timeout": 2000 }, "style": "diamond", "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\uFA19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", "trailing_diamond": "\uE0B4 ", - "type": "wakatime" + "type": "wakatime", + "cache": { + "duration": "1minute", + "strategy": "session" + } }, { "background_templates": [ @@ -291,5 +294,5 @@ "foreground": "p:c-secondary-ellipsis", "template": " ... " }, - "version": 2 + "version": 3 } diff --git a/themes/cinnamon.omp.json b/themes/cinnamon.omp.json index 9f0afeee..10d8a05c 100644 --- a/themes/cinnamon.omp.json +++ b/themes/cinnamon.omp.json @@ -65,5 +65,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/clean-detailed.omp.json b/themes/clean-detailed.omp.json index 21965e9b..c01bfd42 100644 --- a/themes/clean-detailed.omp.json +++ b/themes/clean-detailed.omp.json @@ -132,5 +132,5 @@ "foreground": "#FEF5ED", "template": "\ue285 " }, - "version": 2 + "version": 3 } diff --git a/themes/cloud-context.omp.json b/themes/cloud-context.omp.json index 61acfd4f..5fb2f009 100644 --- a/themes/cloud-context.omp.json +++ b/themes/cloud-context.omp.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", - "version": 2, + "version": 3, "console_title_template": "{{ if or .Root .Segments.Git.RepoName }}[ {{ if .Root }}Admin{{ end }}{{ if and .Root .Segments.Git.RepoName }}@{{ end }}{{ if .Segments.Git.RepoName }}{{ .Segments.Git.RepoName }}{{ end }} ]{{ end }} {{ .Folder }}", "palette": { "background-color": "transparent", diff --git a/themes/cloud-native-azure.omp.json b/themes/cloud-native-azure.omp.json index 32bdb992..1158c253 100644 --- a/themes/cloud-native-azure.omp.json +++ b/themes/cloud-native-azure.omp.json @@ -143,5 +143,5 @@ ], "console_title_template": "{{ .Shell }} in {{ .Folder }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/cobalt2.omp.json b/themes/cobalt2.omp.json index fe84c014..b844cbc5 100644 --- a/themes/cobalt2.omp.json +++ b/themes/cobalt2.omp.json @@ -40,5 +40,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/craver.omp.json b/themes/craver.omp.json index 491af607..c5934d43 100644 --- a/themes/craver.omp.json +++ b/themes/craver.omp.json @@ -105,5 +105,5 @@ } ], "console_title_template": "{{if .Root}}(Admin) {{end}}{{.Folder}}", - "version": 2 + "version": 3 } diff --git a/themes/darkblood.omp.json b/themes/darkblood.omp.json index fb2a6536..d2a80cef 100644 --- a/themes/darkblood.omp.json +++ b/themes/darkblood.omp.json @@ -49,5 +49,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/di4am0nd.omp.json b/themes/di4am0nd.omp.json index efdfca3f..a168d2cc 100644 --- a/themes/di4am0nd.omp.json +++ b/themes/di4am0nd.omp.json @@ -79,5 +79,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/dracula.omp.json b/themes/dracula.omp.json index f79fb81a..ce40beb8 100644 --- a/themes/dracula.omp.json +++ b/themes/dracula.omp.json @@ -77,5 +77,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/easy-term.omp.json b/themes/easy-term.omp.json index af025e5b..9c54691b 100644 --- a/themes/easy-term.omp.json +++ b/themes/easy-term.omp.json @@ -152,5 +152,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/emodipt-extend.omp.json b/themes/emodipt-extend.omp.json index 208505aa..37651187 100644 --- a/themes/emodipt-extend.omp.json +++ b/themes/emodipt-extend.omp.json @@ -114,5 +114,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/emodipt.omp.json b/themes/emodipt.omp.json index 325dcc7e..8753721e 100644 --- a/themes/emodipt.omp.json +++ b/themes/emodipt.omp.json @@ -54,5 +54,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/fish.omp.json b/themes/fish.omp.json index 21c106b4..24c2da3c 100644 --- a/themes/fish.omp.json +++ b/themes/fish.omp.json @@ -51,5 +51,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/free-ukraine.omp.json b/themes/free-ukraine.omp.json index cb65301e..84217c90 100644 --- a/themes/free-ukraine.omp.json +++ b/themes/free-ukraine.omp.json @@ -224,5 +224,5 @@ ], "console_title_template": "{{if .Root}}Admin: {{end}} {{.Folder}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/froczh.omp.json b/themes/froczh.omp.json index 8274ef59..0c14d807 100644 --- a/themes/froczh.omp.json +++ b/themes/froczh.omp.json @@ -145,5 +145,5 @@ } ], "console_title_template": "{{if .Root}} \u26a1 {{end}}{{.Folder | replace \"~\" \"🏚\" }} @ {{.HostName}}", - "version": 2 + "version": 3 } diff --git a/themes/gmay.omp.json b/themes/gmay.omp.json index 9949648a..7c2785e9 100644 --- a/themes/gmay.omp.json +++ b/themes/gmay.omp.json @@ -102,5 +102,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/grandpa-style.omp.json b/themes/grandpa-style.omp.json index 93e398d5..c3cd0a36 100644 --- a/themes/grandpa-style.omp.json +++ b/themes/grandpa-style.omp.json @@ -120,5 +120,5 @@ } ], "console_title_template": "{{if .Root}} \u26a1 {{end}}{{.Folder | replace \"~\" \"🏚\" }} @ {{.HostName}}", - "version": 2 + "version": 3 } diff --git a/themes/gruvbox.omp.json b/themes/gruvbox.omp.json index c4325925..268e6120 100644 --- a/themes/gruvbox.omp.json +++ b/themes/gruvbox.omp.json @@ -131,5 +131,5 @@ ], "console_title_template": "{{ .Folder }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/half-life.omp.json b/themes/half-life.omp.json index 19d95f1f..d8f622d7 100644 --- a/themes/half-life.omp.json +++ b/themes/half-life.omp.json @@ -55,5 +55,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/honukai.omp.json b/themes/honukai.omp.json index 686d3ea9..e362b07c 100644 --- a/themes/honukai.omp.json +++ b/themes/honukai.omp.json @@ -75,5 +75,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/hotstick.minimal.omp.json b/themes/hotstick.minimal.omp.json index faea5dba..968e4227 100644 --- a/themes/hotstick.minimal.omp.json +++ b/themes/hotstick.minimal.omp.json @@ -53,5 +53,5 @@ ], "console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}} :: {{.Shell}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/hul10.omp.json b/themes/hul10.omp.json index 48fec88b..f10d929b 100644 --- a/themes/hul10.omp.json +++ b/themes/hul10.omp.json @@ -126,5 +126,5 @@ ], "console_title_template": "{{if .Root}}[root] {{end}}{{.Shell}} in <{{.Folder}}>", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/hunk.omp.json b/themes/hunk.omp.json index 325cb037..f43dd5b6 100644 --- a/themes/hunk.omp.json +++ b/themes/hunk.omp.json @@ -131,5 +131,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/huvix.omp.json b/themes/huvix.omp.json index 56ca1432..8ff19b88 100644 --- a/themes/huvix.omp.json +++ b/themes/huvix.omp.json @@ -79,5 +79,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/if_tea.omp.json b/themes/if_tea.omp.json index 1232234d..ce6c7e98 100644 --- a/themes/if_tea.omp.json +++ b/themes/if_tea.omp.json @@ -171,5 +171,5 @@ "foreground": "#FEF5ED", "template": "\ue285 " }, - "version": 2 + "version": 3 } diff --git a/themes/illusi0n.omp.json b/themes/illusi0n.omp.json index 89304faa..c1ecdee5 100644 --- a/themes/illusi0n.omp.json +++ b/themes/illusi0n.omp.json @@ -79,5 +79,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/iterm2.omp.json b/themes/iterm2.omp.json index b6ac65bd..ff5af88a 100644 --- a/themes/iterm2.omp.json +++ b/themes/iterm2.omp.json @@ -139,5 +139,5 @@ "foreground": "#FFD700", "template": "{{if .Root}}\u26a1 {{end}}🚀 " }, - "version": 2 + "version": 3 } diff --git a/themes/jandedobbeleer.omp.json b/themes/jandedobbeleer.omp.json index eeeba264..79ba2bda 100644 --- a/themes/jandedobbeleer.omp.json +++ b/themes/jandedobbeleer.omp.json @@ -223,5 +223,5 @@ ], "console_title_template": "{{ .Shell }} in {{ .Folder }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/jblab_2021.omp.json b/themes/jblab_2021.omp.json index a7ea811a..439471f7 100644 --- a/themes/jblab_2021.omp.json +++ b/themes/jblab_2021.omp.json @@ -96,5 +96,5 @@ ], "console_title_template": "{{if .Root}} \u26a1 {{end}}{{.Folder | replace \"~\" \"🏠\"}} @ {{.HostName}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/jonnychipz.omp.json b/themes/jonnychipz.omp.json index 442acc3c..1c619b54 100644 --- a/themes/jonnychipz.omp.json +++ b/themes/jonnychipz.omp.json @@ -144,5 +144,5 @@ ], "console_title_template": "{{if .Root}}root :: {{end}}{{.Shell}} :: {{.Folder}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/json.omp.json b/themes/json.omp.json index fd12cd23..ddf9bc5d 100644 --- a/themes/json.omp.json +++ b/themes/json.omp.json @@ -46,5 +46,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/jtracey93.omp.json b/themes/jtracey93.omp.json index da6c9249..3e444671 100644 --- a/themes/jtracey93.omp.json +++ b/themes/jtracey93.omp.json @@ -106,5 +106,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/jv_sitecorian.omp.json b/themes/jv_sitecorian.omp.json index cc5a9153..c8e7222b 100644 --- a/themes/jv_sitecorian.omp.json +++ b/themes/jv_sitecorian.omp.json @@ -162,5 +162,5 @@ ], "console_title_template": "{{if .Root}}Admin: {{end}} {{.Folder}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/kali.omp.json b/themes/kali.omp.json index 3bd87dbf..44cde037 100644 --- a/themes/kali.omp.json +++ b/themes/kali.omp.json @@ -87,5 +87,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/kushal.omp.json b/themes/kushal.omp.json index 933c3f08..9c3638ce 100644 --- a/themes/kushal.omp.json +++ b/themes/kushal.omp.json @@ -210,5 +210,5 @@ "foreground": "#D6DEEB", "template": "\u2570\u2500\u276f " }, - "version": 2 + "version": 3 } diff --git a/themes/lambda.omp.json b/themes/lambda.omp.json index c3e56efa..1d0896a0 100644 --- a/themes/lambda.omp.json +++ b/themes/lambda.omp.json @@ -29,5 +29,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/lambdageneration.omp.json b/themes/lambdageneration.omp.json index 05f53c79..632e2398 100644 --- a/themes/lambdageneration.omp.json +++ b/themes/lambdageneration.omp.json @@ -130,5 +130,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/larserikfinholt.omp.json b/themes/larserikfinholt.omp.json index d237c24c..bf57a2be 100644 --- a/themes/larserikfinholt.omp.json +++ b/themes/larserikfinholt.omp.json @@ -98,5 +98,5 @@ ], "console_title_template": "{{ .Shell }} in {{ .Folder }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/lightgreen.omp.json b/themes/lightgreen.omp.json index 1db31738..92c77ae4 100644 --- a/themes/lightgreen.omp.json +++ b/themes/lightgreen.omp.json @@ -156,5 +156,5 @@ } ], "pwd": "osc99", - "version": 2 + "version": 3 } diff --git a/themes/marcduiker.omp.json b/themes/marcduiker.omp.json index fce09447..97978e39 100644 --- a/themes/marcduiker.omp.json +++ b/themes/marcduiker.omp.json @@ -56,5 +56,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/markbull.omp.json b/themes/markbull.omp.json index 54b2707d..bfac822b 100644 --- a/themes/markbull.omp.json +++ b/themes/markbull.omp.json @@ -115,5 +115,5 @@ ], "console_title_template": "{{if .Root}}\u26a1 {{end}}{{.Folder}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/material.omp.json b/themes/material.omp.json index c29f335f..5c648671 100644 --- a/themes/material.omp.json +++ b/themes/material.omp.json @@ -48,5 +48,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/microverse-power.omp.json b/themes/microverse-power.omp.json index a96162ad..a453d5ad 100644 --- a/themes/microverse-power.omp.json +++ b/themes/microverse-power.omp.json @@ -92,5 +92,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/mojada.omp.json b/themes/mojada.omp.json index 9142e2e8..0d9dde2e 100644 --- a/themes/mojada.omp.json +++ b/themes/mojada.omp.json @@ -142,5 +142,5 @@ ], "console_title_template": "{{.UserName}}@{{.HostName}} : {{.Folder}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/montys.omp.json b/themes/montys.omp.json index fcb5fd5a..4098eda4 100644 --- a/themes/montys.omp.json +++ b/themes/montys.omp.json @@ -109,5 +109,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/mt.omp.json b/themes/mt.omp.json index 8f2d385c..edb64dae 100644 --- a/themes/mt.omp.json +++ b/themes/mt.omp.json @@ -61,5 +61,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/multiverse-neon.omp.json b/themes/multiverse-neon.omp.json index 9282e5d4..95e71c30 100644 --- a/themes/multiverse-neon.omp.json +++ b/themes/multiverse-neon.omp.json @@ -111,5 +111,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/negligible.omp.json b/themes/negligible.omp.json index b293e13e..068098e0 100644 --- a/themes/negligible.omp.json +++ b/themes/negligible.omp.json @@ -106,5 +106,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/neko.omp.json b/themes/neko.omp.json index c140f12a..8ea9ed3c 100644 --- a/themes/neko.omp.json +++ b/themes/neko.omp.json @@ -64,5 +64,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/night-owl.omp.json b/themes/night-owl.omp.json index d38c393d..6189b69d 100644 --- a/themes/night-owl.omp.json +++ b/themes/night-owl.omp.json @@ -412,5 +412,5 @@ "foreground": "#d6deeb", "template": "\ue285 " }, - "version": 2 + "version": 3 } diff --git a/themes/nordtron.omp.json b/themes/nordtron.omp.json index 71ac50de..db4f0a9b 100644 --- a/themes/nordtron.omp.json +++ b/themes/nordtron.omp.json @@ -79,5 +79,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/nu4a.omp.json b/themes/nu4a.omp.json index d7590991..80fef2a6 100644 --- a/themes/nu4a.omp.json +++ b/themes/nu4a.omp.json @@ -89,5 +89,5 @@ "foreground": "#100e23", "template": " \uf061 " }, - "version": 2 + "version": 3 } diff --git a/themes/onehalf.minimal.omp.json b/themes/onehalf.minimal.omp.json index 62d3a3e8..5e813e9d 100644 --- a/themes/onehalf.minimal.omp.json +++ b/themes/onehalf.minimal.omp.json @@ -65,5 +65,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/paradox.omp.json b/themes/paradox.omp.json index 62e59b4b..9051dffd 100644 --- a/themes/paradox.omp.json +++ b/themes/paradox.omp.json @@ -74,5 +74,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/pararussel.omp.json b/themes/pararussel.omp.json index c81e13eb..16bc48ad 100644 --- a/themes/pararussel.omp.json +++ b/themes/pararussel.omp.json @@ -67,5 +67,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/patriksvensson.omp.json b/themes/patriksvensson.omp.json index b438cd4b..571ca56a 100644 --- a/themes/patriksvensson.omp.json +++ b/themes/patriksvensson.omp.json @@ -75,5 +75,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/peru.omp.json b/themes/peru.omp.json index 499386bd..1447311f 100644 --- a/themes/peru.omp.json +++ b/themes/peru.omp.json @@ -113,5 +113,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/pixelrobots.omp.json b/themes/pixelrobots.omp.json index b8965eb2..462aed01 100644 --- a/themes/pixelrobots.omp.json +++ b/themes/pixelrobots.omp.json @@ -152,5 +152,5 @@ ], "console_title_template": "{{if .Root}}root :: {{end}}{{.Shell}} :: {{.Folder}}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/plague.omp.json b/themes/plague.omp.json index 3fc5c39a..79de0a97 100644 --- a/themes/plague.omp.json +++ b/themes/plague.omp.json @@ -86,5 +86,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/poshmon.omp.json b/themes/poshmon.omp.json index fe578fe7..0686159a 100644 --- a/themes/poshmon.omp.json +++ b/themes/poshmon.omp.json @@ -122,6 +122,6 @@ "console_title_template": "{{ .Folder }}", "final_space": true, "osc99": true, - "version": 2 + "version": 3 } diff --git a/themes/powerlevel10k_classic.omp.json b/themes/powerlevel10k_classic.omp.json index ad2c3eb9..4e8ecac8 100644 --- a/themes/powerlevel10k_classic.omp.json +++ b/themes/powerlevel10k_classic.omp.json @@ -89,5 +89,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/powerlevel10k_lean.omp.json b/themes/powerlevel10k_lean.omp.json index 48c69e88..44146266 100644 --- a/themes/powerlevel10k_lean.omp.json +++ b/themes/powerlevel10k_lean.omp.json @@ -43,5 +43,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/powerlevel10k_modern.omp.json b/themes/powerlevel10k_modern.omp.json index d12186bc..4559f0dc 100644 --- a/themes/powerlevel10k_modern.omp.json +++ b/themes/powerlevel10k_modern.omp.json @@ -100,5 +100,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/powerlevel10k_rainbow.omp.json b/themes/powerlevel10k_rainbow.omp.json index 9c13ba09..8a69cacb 100644 --- a/themes/powerlevel10k_rainbow.omp.json +++ b/themes/powerlevel10k_rainbow.omp.json @@ -212,5 +212,5 @@ ], "console_title_template": "{{ .Shell }} in {{ .Folder }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/powerline.omp.json b/themes/powerline.omp.json index 4bf9b5a6..211d9c97 100644 --- a/themes/powerline.omp.json +++ b/themes/powerline.omp.json @@ -56,5 +56,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/probua.minimal.omp.json b/themes/probua.minimal.omp.json index f700f1db..a6e6a5dc 100644 --- a/themes/probua.minimal.omp.json +++ b/themes/probua.minimal.omp.json @@ -51,5 +51,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/pure.omp.json b/themes/pure.omp.json index a0468e73..0781f153 100644 --- a/themes/pure.omp.json +++ b/themes/pure.omp.json @@ -86,5 +86,5 @@ ], "template": "\u276f " }, - "version": 2 + "version": 3 } diff --git a/themes/quick-term.omp.json b/themes/quick-term.omp.json index f2aac4b0..ae46d602 100644 --- a/themes/quick-term.omp.json +++ b/themes/quick-term.omp.json @@ -124,5 +124,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/remk.omp.json b/themes/remk.omp.json index 031596b5..5148c90c 100644 --- a/themes/remk.omp.json +++ b/themes/remk.omp.json @@ -48,5 +48,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/robbyrussell.omp.json b/themes/robbyrussell.omp.json index 3b0ae7f9..6dc3da95 100644 --- a/themes/robbyrussell.omp.json +++ b/themes/robbyrussell.omp.json @@ -39,5 +39,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/rudolfs-dark.omp.json b/themes/rudolfs-dark.omp.json index 95da2d68..383f11cb 100644 --- a/themes/rudolfs-dark.omp.json +++ b/themes/rudolfs-dark.omp.json @@ -72,5 +72,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/rudolfs-light.omp.json b/themes/rudolfs-light.omp.json index 91d5cab7..85ae5159 100644 --- a/themes/rudolfs-light.omp.json +++ b/themes/rudolfs-light.omp.json @@ -72,5 +72,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/sim-web.omp.json b/themes/sim-web.omp.json index cffbca0f..9e821e0a 100644 --- a/themes/sim-web.omp.json +++ b/themes/sim-web.omp.json @@ -82,5 +82,5 @@ "foreground": "#FEF5ED", "template": "{{ .Shell }}" }, - "version": 2 + "version": 3 } diff --git a/themes/slim.omp.json b/themes/slim.omp.json index c4fe36b2..93e8b0a6 100644 --- a/themes/slim.omp.json +++ b/themes/slim.omp.json @@ -183,5 +183,5 @@ "foreground": "#7a7a7a", "template": " ~#@\u276f " }, - "version": 2 + "version": 3 } diff --git a/themes/slimfat.omp.json b/themes/slimfat.omp.json index ecd10bbe..2d938b99 100644 --- a/themes/slimfat.omp.json +++ b/themes/slimfat.omp.json @@ -181,5 +181,5 @@ "foreground": "#7a7a7a", "template": " ~#@\u276f " }, - "version": 2 + "version": 3 } diff --git a/themes/smoothie.omp.json b/themes/smoothie.omp.json index 02d3bc04..6ee1fc3b 100644 --- a/themes/smoothie.omp.json +++ b/themes/smoothie.omp.json @@ -96,5 +96,5 @@ "type": "rprompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/sonicboom_dark.omp.json b/themes/sonicboom_dark.omp.json index 85d10945..ce91605a 100644 --- a/themes/sonicboom_dark.omp.json +++ b/themes/sonicboom_dark.omp.json @@ -121,5 +121,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/sonicboom_light.omp.json b/themes/sonicboom_light.omp.json index ab6f749d..dcce6533 100644 --- a/themes/sonicboom_light.omp.json +++ b/themes/sonicboom_light.omp.json @@ -121,5 +121,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/sorin.omp.json b/themes/sorin.omp.json index d2e59d0e..6eec902a 100644 --- a/themes/sorin.omp.json +++ b/themes/sorin.omp.json @@ -53,5 +53,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/space.omp.json b/themes/space.omp.json index ea5df8d7..77331aff 100644 --- a/themes/space.omp.json +++ b/themes/space.omp.json @@ -83,5 +83,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/spaceship.omp.json b/themes/spaceship.omp.json index 17e29dfc..2a022e83 100644 --- a/themes/spaceship.omp.json +++ b/themes/spaceship.omp.json @@ -47,5 +47,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/star.omp.json b/themes/star.omp.json index 360cf1c2..cd11cd19 100644 --- a/themes/star.omp.json +++ b/themes/star.omp.json @@ -60,5 +60,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/stelbent-compact.minimal.omp.json b/themes/stelbent-compact.minimal.omp.json index ca5b54c8..546b0987 100644 --- a/themes/stelbent-compact.minimal.omp.json +++ b/themes/stelbent-compact.minimal.omp.json @@ -107,5 +107,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/stelbent.minimal.omp.json b/themes/stelbent.minimal.omp.json index 65f2819b..878ac3ea 100644 --- a/themes/stelbent.minimal.omp.json +++ b/themes/stelbent.minimal.omp.json @@ -118,5 +118,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/takuya.omp.json b/themes/takuya.omp.json index fdeb90b1..4f40b04e 100644 --- a/themes/takuya.omp.json +++ b/themes/takuya.omp.json @@ -111,5 +111,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/the-unnamed.omp.json b/themes/the-unnamed.omp.json index 3fa1342e..558f3313 100644 --- a/themes/the-unnamed.omp.json +++ b/themes/the-unnamed.omp.json @@ -60,5 +60,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/thecyberden.omp.json b/themes/thecyberden.omp.json index d92cbfa3..09d7a636 100644 --- a/themes/thecyberden.omp.json +++ b/themes/thecyberden.omp.json @@ -105,5 +105,5 @@ } ], "console_title_template": "{{ .Folder }}", - "version": 2 + "version": 3 } diff --git a/themes/tiwahu.omp.json b/themes/tiwahu.omp.json index c9d2d28b..5d3a4a5a 100644 --- a/themes/tiwahu.omp.json +++ b/themes/tiwahu.omp.json @@ -142,5 +142,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/tokyo.omp.json b/themes/tokyo.omp.json index cbfb599b..e7fc64b3 100644 --- a/themes/tokyo.omp.json +++ b/themes/tokyo.omp.json @@ -112,5 +112,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/tokyonight_storm.omp.json b/themes/tokyonight_storm.omp.json index a8820a72..ad31f31f 100644 --- a/themes/tokyonight_storm.omp.json +++ b/themes/tokyonight_storm.omp.json @@ -141,6 +141,6 @@ "template": "\u279c " }, "final_space": true, - "version": 2, + "version": 3, "terminal_background": "p:t-background" } diff --git a/themes/tonybaloney.omp.json b/themes/tonybaloney.omp.json index fa3763a8..a764c64b 100644 --- a/themes/tonybaloney.omp.json +++ b/themes/tonybaloney.omp.json @@ -49,5 +49,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/uew.omp.json b/themes/uew.omp.json index ee214c14..e827995f 100644 --- a/themes/uew.omp.json +++ b/themes/uew.omp.json @@ -121,5 +121,5 @@ "foreground": "#FEF5ED", "template": "\ue285 " }, - "version": 2 + "version": 3 } diff --git a/themes/unicorn.omp.json b/themes/unicorn.omp.json index ef5e34e7..7b778d7f 100644 --- a/themes/unicorn.omp.json +++ b/themes/unicorn.omp.json @@ -90,5 +90,5 @@ ], "console_title_template": "{{.UserName}}@{{.HostName}} in {{ .PWD }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/velvet.omp.json b/themes/velvet.omp.json index a5b51d43..8cf05123 100644 --- a/themes/velvet.omp.json +++ b/themes/velvet.omp.json @@ -166,5 +166,5 @@ ], "console_title_template": "{{ .Shell }} - {{ .Folder }}", "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/wholespace.omp.json b/themes/wholespace.omp.json index 0c2a8bb1..11ef4ad5 100644 --- a/themes/wholespace.omp.json +++ b/themes/wholespace.omp.json @@ -133,5 +133,5 @@ "foreground": "#FEF5ED", "template": "\ue285 " }, - "version": 2 + "version": 3 } diff --git a/themes/wopian.omp.json b/themes/wopian.omp.json index 54962bb8..78d87ff2 100644 --- a/themes/wopian.omp.json +++ b/themes/wopian.omp.json @@ -103,5 +103,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/xtoys.omp.json b/themes/xtoys.omp.json index e07ff6e0..a1911e5b 100644 --- a/themes/xtoys.omp.json +++ b/themes/xtoys.omp.json @@ -50,5 +50,5 @@ "type": "prompt" } ], - "version": 2 + "version": 3 } diff --git a/themes/ys.omp.json b/themes/ys.omp.json index 213947c7..974d0f74 100644 --- a/themes/ys.omp.json +++ b/themes/ys.omp.json @@ -84,5 +84,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 } diff --git a/themes/zash.omp.json b/themes/zash.omp.json index 41382ceb..9f1736de 100644 --- a/themes/zash.omp.json +++ b/themes/zash.omp.json @@ -45,5 +45,5 @@ } ], "final_space": true, - "version": 2 + "version": 3 }