Closed darkred closed 2 months ago
@darkred This isn't a bug. When you edit the themes that ship with oh-my-posh, they get overridden with their latest versions on upgrade. You need to copy the theme you want elsewhere and edit that.
Thanks for the clarification.
By the way, I'd like to make a suggestion: For use cases like mine where I use a theme that ships with oh-my-posh intact (without any changes), it might be more convenient to have an extra settings_general.json
file pointing to that theme file, containing only general settings like auto_upgrade
and disable_notice
(ref).
Also, this way the used theme file would be updated on every oh-my-posh upgrade (currently, because it's copied+renamed, it's only updated manually by the user).
@darkred themes are pretty stable and there's also a migration functionality for huge changes. This'll be fine.
Code of Conduct
What happened?
I have
auto_upgrade
anddisable_notice
set to true in settings. However, when I open a new pwsh session (in my case 7.4.3) inside windows terminal, if there's a new version available and gets downloaded, settings are gone after closing the terminal.STR
C:\Users\Kostas\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json
and add two entries near the end.Theme
The entire
```log { "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", "blocks": [ { "alignment": "left", "segments": [ { "background": "#c386f1", "foreground": "#ffffff", "leading_diamond": "\ue0b6", "style": "diamond", "template": " {{ .UserName }} ", "trailing_diamond": "\ue0b0", "type": "session" }, { "background": "#ff479c", "foreground": "#ffffff", "powerline_symbol": "\ue0b0", "properties": { "folder_separator_icon": " \ue0b1 ", "home_icon": "~", "style": "folder" }, "style": "powerline", "template": " \uea83 {{ .Path }} ", "type": "path" }, { "background": "#fffb38", "background_templates": [ "{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}", "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}", "{{ if gt .Ahead 0 }}#B388FF{{ end }}", "{{ if gt .Behind 0 }}#B388FF{{ end }}" ], "foreground": "#193549", "leading_diamond": "\ue0b6", "powerline_symbol": "\ue0b0", "properties": { "branch_max_length": 25, "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true }, "style": "powerline", "template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ", "trailing_diamond": "\ue0b4", "type": "git" }, { "background": "#6CA35E", "foreground": "#ffffff", "powerline_symbol": "\ue0b0", "properties": { "fetch_version": true }, "style": "powerline", "template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ", "type": "node" }, { "background": "#8ED1F7", "foreground": "#111111", "powerline_symbol": "\ue0b0", "properties": { "fetch_version": true }, "style": "powerline", "template": " \ue626 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ", "type": "go" }, { "background": "#4063D8", "foreground": "#111111", "powerline_symbol": "\ue0b0", "properties": { "fetch_version": true }, "style": "powerline", "template": " \ue624 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ", "type": "julia" }, { "background": "#FFDE57", "foreground": "#111111", "powerline_symbol": "\ue0b0", "properties": { "display_mode": "files", "fetch_virtual_env": false }, "style": "powerline", "template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ", "type": "python" }, { "background": "#AE1401", "foreground": "#ffffff", "powerline_symbol": "\ue0b0", "properties": { "display_mode": "files", "fetch_version": true }, "style": "powerline", "template": " \ue791 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ", "type": "ruby" }, { "background": "#FEAC19", "foreground": "#ffffff", "powerline_symbol": "\ue0b0", "properties": { "display_mode": "files", "fetch_version": false }, "style": "powerline", "template": " \uf0e7{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ", "type": "azfunc" }, { "background_templates": [ "{{if contains \"default\" .Profile}}#FFA400{{end}}", "{{if contains \"jan\" .Profile}}#f1184c{{end}}" ], "foreground": "#ffffff", "powerline_symbol": "\ue0b0", "properties": { "display_default": false }, "style": "powerline", "template": " \ue7ad {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ", "type": "aws" }, { "background": "#ffff66", "foreground": "#111111", "powerline_symbol": "\ue0b0", "style": "powerline", "template": " \uf0ad ", "type": "root" }, { "background": "#83769c", "foreground": "#ffffff", "properties": { "always_enabled": true }, "style": "plain", "template": "jandedobbeleer.omp.json
config file (click to expand):The only settings I modified which are gone after closing the terminal are:
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
PS. Rather unrelated issue of 3 years ago: #680.