Repository: JanDeDobbeleer/oh-my-posh (Go)

Issue:
18.10.0 Text Color Issue
### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

### What happened?

After updating to 18.10.0, some text segments in my theme have inverted foreground and background colors. Can't seem to find a particular reason why it's happening to some parts and not others.

**Update:** Reverting to previous versions doensn't seem to help either, so I'm not confident it's a version thing. I just can't work out why this suddenly started happening.

![24-09-23_10-27-52_WindowsTerminal](https://github.com/JanDeDobbeleer/oh-my-posh/assets/43902253/cbbeff6e-8fe9-4b75-a080-e408bd31106a)
![24-09-23_10-28-30_WindowsTerminal](https://github.com/JanDeDobbeleer/oh-my-posh/assets/43902253/47934edc-3055-447b-976d-b3a9c8d5bdb5)


### Theme

I'm using a customised version of [blue-owl](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/blue-owl.omp.json):

```json
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "console_title_template": "{{if .Root}} \u26a1 {{end}}{{.Folder | replace \"~\" \"🏚\" }} @ {{.Host}}",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "root",
          "style": "plain",
          "foreground": "#FFEB3B",
          "background": "#a313a8",
          "template": " \uf0e7 ",
          "properties": {
            "root_icon": "\u26a1"
          }
        },
        {
          "type": "os",
          "style": "plain",
          "foreground": "#ffffff",
          "background": "transparent",
          "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}} "
        },
        {
          "type": "path",
          "style": "diamond",
          "foreground": "#ffffff",
          "background": "#01579B",
          "leading_diamond": "<transparent,#01579B>\ue0b0</>",
          "trailing_diamond": "\ue0b0",
          "template": " {{ .Path }} ",
          "properties": {
            "folder_icon": "\uf6d7",
            "folder_separator_icon": "<transparent> \ue0bd </>",
            "home_icon": "\uf7db",
            "style": "agnoster_short"
          }
        },
        {
          "type": "git",
          "style": "diamond",
          "foreground": "#b6def3",
          "foreground_templates": [
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}",
            "{{ if gt .Ahead 0 }}#B388FF{{ end }}",
            "{{ if gt .Behind 0 }}#B388FF{{ end }}"
          ],
          "background": "#29315A",
          "leading_diamond": "<transparent,#29315A>\ue0b0</>",
          "trailing_diamond": "\ue0b0",
          "template": " {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}<#c7c7c7>{{ .Working.String }}</>{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }}|{{ end }}{{ if .Staging.Changed }}<#a3ecb9>{{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0}}{{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}}{{ .WorktreeCount }}{{ end }} ",
          "properties": {
            "branch_ahead_icon": "\u2191",
            "branch_behind_icon": "\u2193",
            "branch_gone_icon": "\u2262",
            "branch_icon": "<#b6def3>\uf418\u2009</>",
            "branch_identical_icon": "\u2261",
            "fetch_stash_count": true,
            "fetch_status": true
          }
        }
      ],
      "newline": true
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "session",
          "style": "diamond",
          "foreground": "#43CCEA",
          "background": "#262d53",
          "leading_diamond": "\ue0c5",
          "template": "  {{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }}<transparent> / </>{{ .HostName }}<transparent> </>"
        },
        {
          "type": "executiontime",
          "style": "plain",
          "foreground": "#ffffff",
          "background": "#29315A",
          "template": "<transparent,#232a4d>\ue0ba</><transparent>\ue0bc </>{{ .FormattedMs }} ",
          "properties": {
            "style": "round",
            "threshold": 3000
          }
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "status",
          "style": "plain",
          "foreground": "#43CCDF",
          "foreground_templates": ["{{ if gt .Code 0 }}#E06C75{{ end }}"],
          "template": "\u276f ",
          "properties": {
            "always_enabled": true
          }
        }
      ],
      "newline": true
    }
  ],
  "osc99": true
}

```

### What OS are you seeing the problem on?

Windows

### Which shell are you using?

cmd, powershell

### Log output

```Shell
Version: 18.10.0

Shell: pwsh (7.3.6)

Prompt:

       test   master ≡?1                                                                                   Luke / LUKE_BEAST
❯

Segments:

ConsoleTitle(true)                         -   0 ms
Root(false)                                -   0 ms
Os(true)                                   -   0 ms
Path(true)                                 -   1 ms
Git(true)                                  -  35 ms
Session(true)                              -   0 ms
Executiontime(false)                       -   0 ms
Status(true)                               -   0 ms

Run duration: 42.8255ms

Cache path: C:\Users\Luke\AppData\Local\oh-my-posh

Config path: C:\Users\Luke\.config\oh-my-posh\lpke-psh.omp.json

Logs:

[DEBUG] 10:34:15.830 shell.go:Getenv:392 → NO DATA
[TRACE] 10:34:15.830 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 10:34:15.830 shell.go:Getenv:392 → C:\Users\Luke\AppData\Local
[TRACE] 10:34:15.830 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 10:34:15.830 shell_windows.go:CachePath() - 0s
[DEBUG] 10:34:15.831 shell.go:Getenv:392 → C:\Users\Luke\.config\oh-my-posh\lpke-psh.omp.json
[TRACE] 10:34:15.831 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 10:34:15.831 shell.go:Shell:632 → no shell name provided in flags, trying to detect it
[DEBUG] 10:34:15.835 shell.go:Shell:640 → process name: pwsh.exe
[TRACE] 10:34:15.835 shell.go:Shell() - 3.6429ms
[TRACE] 10:34:15.835 shell.go:resolveConfigPath() - 3.6429ms
[TRACE] 10:34:15.835 shell.go:Init() - 4.1612ms
[TRACE] 10:34:15.835 shell.go:Flags() - 0s
[TRACE] 10:34:15.835 config.go:loadConfig() - 515.5µs
[TRACE] 10:34:15.835 shell.go:Flags() - 0s
[DEBUG] 10:34:15.835 shell.go:Getenv:392 → NO DATA
[TRACE] 10:34:15.835 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 10:34:15.835 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[TRACE] 10:34:15.835 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.835 shell_windows.go:WindowsRegistryKeyValue:215 → ColorizationColor(DWORD): 0xC400B294
[TRACE] 10:34:15.835 shell.go:Shell() - 0s
[DEBUG] 10:34:15.835 shell.go:Getenv:392 → 7.3.6
[TRACE] 10:34:15.835 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 10:34:15.835 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 10:34:15.835 text.go:Render:70 → Rendering template: {{if .Root}} ⚡ {{end}}{{.Folder | replace "~" "🏚" }} @ {{.Host}}
[TRACE] 10:34:15.836 shell_windows.go:Root() - 0s
[TRACE] 10:34:15.836 shell.go:Shell() - 0s
[TRACE] 10:34:15.836 shell.go:StatusCodes() - 0s
[TRACE] 10:34:15.836 shell_windows.go:IsWsl() - 0s
[DEBUG] 10:34:15.836 shell.go:TemplateCache:813 → environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\Luke\AppData\Roaming asl.log=Destination=file CLINK_DIR=C:\Program Files (x86)\clink CLINK_PROFILE=C:\Users\Luke\.config\clink CLINK_SETTINGS=C:\Users\Luke\.config\clink CLINK_TERM_VE=\e[6 q CLINK_TERM_VS=\e[2 q CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=LUKE_BEAST ComSpec=C:\Windows\system32\cmd.exe CONDA_PROMPT_MODIFIER=False DriverData=C:\Windows\System32\Drivers\DriverData EDITOR=vim GIT_INSTALL_ROOT=C:\Users\Luke\scoop\apps\git\current GRADLE_USER_HOME=C:\Users\Luke\scoop\apps\gradle\current\.gradle HOMEDRIVE=C: HOMEPATH=\Users\Luke LOCALAPPDATA=C:\Users\Luke\AppData\Local LOGONSERVER=\\LUKE_BEAST NUMBER_OF_PROCESSORS=32 NVM_HOME=C:\Users\Luke\scoop\apps\nvm\current NVM_SYMLINK=C:\Users\Luke\scoop\persist\nvm\nodejs\nodejs OculusBase=C:\Program Files\Oculus\ OneDrive=C:\Users\Luke\OneDrive OS=Windows_NT Path=C:\Program Files\PowerShell\7;C:\Program Files\Oculus\Support\oculus-runtime;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\PowerShell\7\;C:\Users\Luke\scoop\apps\nvm\current\nodejs\nodejs;C:\Users\Luke\scoop\shims;C:\Users\Luke\AppData\Local\Microsoft\WindowsApps;C:\Users\Luke\AppData\Local\Programs\oh-my-posh\bin;C:\Users\Luke\AppData\Local\Programs\Microsoft VS Code Insiders\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL POSH_AZURE_ENABLED=False POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=1 POSH_GIT_ENABLED=False POSH_INSTALLER=scoop POSH_PID=15268 POSH_SHELL_VERSION=7.3.6 POSH_THEME=C:\Users\Luke\.config\oh-my-posh\lpke-psh.omp.json POSH_THEMES_PATH=C:\Users\Luke\AppData\Local\Programs\oh-my-posh\themes POWERLINE_COMMAND=oh-my-posh POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Pro PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD PROCESSOR_LEVEL=25 PROCESSOR_REVISION=2100 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Users\Luke\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\Luke\AppData\Local\Temp TMP=C:\Users\Luke\AppData\Local\Temp USERDOMAIN=LUKE_BEAST USERDOMAIN_ROAMINGPROFILE=LUKE_BEAST USERNAME=Luke USERPROFILE=C:\Users\Luke VIFM=C:/Users/Luke/.config/vifm windir=C:\Windows WSLENV=WT_SESSION::WT_PROFILE_ID WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} WT_SESSION=0f6604c9-2fc9-4b43-9ddb-62ac30ea04a9]
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.836 shell.go:Pwd:422 → C:\Users\Luke\Downloads\test
[TRACE] 10:34:15.836 shell.go:Pwd() - 0s
[DEBUG] 10:34:15.836 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.836 shell.go:User:543 → Luke
[TRACE] 10:34:15.836 shell.go:User() - 0s
[DEBUG] 10:34:15.836 shell.go:Host:555 → LUKE_BEAST
[TRACE] 10:34:15.836 shell.go:Host() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.836 shell.go:Getenv:392 → NO DATA
[TRACE] 10:34:15.836 shell.go:Getenv(SHLVL) - 0s
[TRACE] 10:34:15.836 shell.go:TemplateCache() - 0s
[ERROR] 10:34:15.836 text.go:Render:86 → template: {{if .Root}} ⚡ {{end}}{{.Folder | replace "~" "🏚" }} @ {{.Data.Host}}:1:67: executing "{{if .Root}} ⚡ {{end}}{{.Folder | replace \"~\" \"🏚\" }} @ {{.Data.Host}}" at <.Data.Host>: nil pointer evaluating template.Data.Host
[DEBUG] 10:34:15.836 shell.go:Getenv:392 → 1
[TRACE] 10:34:15.836 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 10:34:15.836 shell.go:Getenv:392 → 1
[TRACE] 10:34:15.836 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 10:34:15.836 shell.go:Flags() - 0s
[TRACE] 10:34:15.836 shell.go:Flags() - 0s
[TRACE] 10:34:15.836 shell.go:Shell() - 0s
[TRACE] 10:34:15.836 shell.go:Shell() - 0s
[TRACE] 10:34:15.836 shell.go:Flags() - 0s
[TRACE] 10:34:15.836 shell.go:Flags() - 0s
[TRACE] 10:34:15.836 shell.go:Pwd() - 0s
[DEBUG] 10:34:15.836 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:Pwd() - 0s
[TRACE] 10:34:15.836 shell.go:Flags() - 0s
[DEBUG] 10:34:15.836 segment.go:SetEnabled:497 → Segment: Git
[DEBUG] 10:34:15.836 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.836 segment.go:SetEnabled:497 → Segment: Root
[TRACE] 10:34:15.836 shell.go:Pwd() - 0s
[TRACE] 10:34:15.836 shell.go:Flags() - 0s
[DEBUG] 10:34:15.836 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.836 segment.go:SetEnabled:497 → Segment: Os
[TRACE] 10:34:15.836 shell_windows.go:Root() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:Pwd() - 0s
[DEBUG] 10:34:15.836 properties.go:GetString:28 → 
[DEBUG] 10:34:15.836 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.836 shell.go:TemplateCache() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.836 segment.go:SetEnabled:497 → Segment: Path
[TRACE] 10:34:15.836 shell.go:Pwd() - 0s
[TRACE] 10:34:15.836 shell.go:Shell() - 0s
[TRACE] 10:34:15.836 shell.go:Flags() - 0s
[DEBUG] 10:34:15.836 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 10:34:15.836 properties.go:GetString:28 → 
[DEBUG] 10:34:15.836 properties.go:GetString:28 → 
[DEBUG] 10:34:15.836 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.836 properties.go:GetString:28 → 
[DEBUG] 10:34:15.836 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 10:34:15.836 shell.go:PathSeparator() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.836 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:GOOS() - 0s
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[DEBUG] 10:34:15.837 properties.go:GetString:28 → agnoster_short
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[DEBUG] 10:34:15.837 properties.go:GetInt:40 → max_depth: 1
[DEBUG] 10:34:15.837 properties.go:GetString:28 → 
[DEBUG] 10:34:15.837 properties.go:GetBool:22 → hide_root_location: false
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[DEBUG] 10:34:15.837 properties.go:GetStringArray:52 → cycle: []
[DEBUG] 10:34:15.837 properties.go:GetString:28 → NO DATA
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[DEBUG] 10:34:15.837 properties.go:GetString:28 → <transparent>  </>
[DEBUG] 10:34:15.837 properties.go:GetBool:22 → cycle_folder_separator: false
[DEBUG] 10:34:15.837 properties.go:GetString:28 → %s
[DEBUG] 10:34:15.837 properties.go:GetString:28 → %s
[TRACE] 10:34:15.837 shell.go:PathSeparator() - 0s
[TRACE] 10:34:15.837 shell.go:Pwd() - 0s
[TRACE] 10:34:15.837 shell_windows.go:IsWsl() - 0s
[TRACE] 10:34:15.837 shell.go:StackCount() - 0s
[DEBUG] 10:34:15.837 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 10:34:15.837 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 10:34:15.837 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 10:34:15.837 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 10:34:15.837 shell_windows.go:DirIsWritable() - 518µs
[TRACE] 10:34:15.837 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.839 shell.go:CommandPath:594 → C:\Users\Luke\scoop\shims\git.exe
[TRACE] 10:34:15.839 shell.go:CommandPath(git.exe) - 3.6801ms
[TRACE] 10:34:15.839 shell.go:HasCommand(git.exe) - 3.6801ms
[TRACE] 10:34:15.839 shell.go:Pwd() - 0s
[TRACE] 10:34:15.839 shell.go:HasParentFilePath(.git) - 0s
[DEBUG] 10:34:15.839 properties.go:GetStringArray:52 → exclude_folders: []
[DEBUG] 10:34:15.839 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.839 properties.go:GetBool:22 → fetch_user: false
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.839 shell.go:Getenv:392 → NO DATA
[TRACE] 10:34:15.839 shell.go:Getenv(POSH_GIT_STATUS) - 0s
[DEBUG] 10:34:15.839 properties.go:GetBool:22 → fetch_status: true
[DEBUG] 10:34:15.839 properties.go:GetStringArray:52 → ignore_status: []
[DEBUG] 10:34:15.839 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.839 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.839 properties.go:GetKeyValueMap:46 → status_formats: map[]
[DEBUG] 10:34:15.839 properties.go:GetKeyValueMap:46 → untracked_modes: map[]
[DEBUG] 10:34:15.839 properties.go:GetKeyValueMap:46 → ignore_submodules: map[]
[DEBUG] 10:34:15.871 shell.go:RunCommand:573 ↓
    # branch.oid 2208a9d07670b1cda4d81c6ebab7bad02196797b
    # branch.head master
    # branch.upstream origin/master
    # branch.ab +0 -0
    ? test2.txt
[TRACE] 10:34:15.871 shell.go:RunCommand(git.exe -C C:/Users/Luke/Downloads/test --no-optional-locks -c core.quotepath=false -c color.status=false status -unormal --branch --porcelain=2) - 31.8743ms
[DEBUG] 10:34:15.871 properties.go:GetString:28 → <#b6def3> </>
[DEBUG] 10:34:15.871 properties.go:GetInt:40 → branch_max_length: 0
[DEBUG] 10:34:15.871 shell.go:HasFolder:487 → false
[TRACE] 10:34:15.871 shell.go:HasFolder(C:\Users\Luke\Downloads\test\.git/rebase-merge) - 0s
[DEBUG] 10:34:15.871 shell.go:HasFolder:487 → false
[TRACE] 10:34:15.871 shell.go:HasFolder(C:\Users\Luke\Downloads\test\.git/rebase-apply) - 0s
[DEBUG] 10:34:15.871 properties.go:GetString:28 → 
[DEBUG] 10:34:15.871 shell.go:HasFilesInDir:458 → false
[TRACE] 10:34:15.871 shell.go:HasFilesInDir(MERGE_MSG) - 0s
[DEBUG] 10:34:15.871 shell.go:HasFilesInDir:458 → false
[TRACE] 10:34:15.871 shell.go:HasFilesInDir(CHERRY_PICK_HEAD) - 0s
[DEBUG] 10:34:15.871 shell.go:HasFilesInDir:458 → false
[TRACE] 10:34:15.871 shell.go:HasFilesInDir(REVERT_HEAD) - 0s
[DEBUG] 10:34:15.871 shell.go:HasFilesInDir:458 → false
[TRACE] 10:34:15.871 shell.go:HasFilesInDir(sequencer/todo) - 0s
[DEBUG] 10:34:15.871 properties.go:GetString:28 → ≡
[DEBUG] 10:34:15.871 properties.go:GetBool:22 → fetch_upstream_icon: false
[TRACE] 10:34:15.871 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.871 text.go:Render:70 → Rendering template:  {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}<#c7c7c7>{{ .Working.String }}</>{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }}|{{ end }}{{ if .Staging.Changed }}<#a3ecb9>{{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0}}{{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}}{{ .WorktreeCount }}{{ end }}
[DEBUG] 10:34:15.871 text.go:Render:70 → Rendering template:  {{ if .WSL }}WSL at {{ end }}{{.Icon}}
[DEBUG] 10:34:15.871 text.go:Render:70 → Rendering template:  {{ .Path }}
[TRACE] 10:34:15.871 shell.go:TemplateCache() - 0s
[TRACE] 10:34:15.871 shell.go:TemplateCache() - 0s
[TRACE] 10:34:15.871 shell.go:Shell() - 0s
[TRACE] 10:34:15.871 shell.go:Shell() - 0s
[TRACE] 10:34:15.871 shell.go:TemplateCache() - 0s
[ERROR] 10:34:15.872 shell.go:FileContent:513 → open C:\Users\Luke\Downloads\test\.git/logs/refs/stash: The system cannot find the file specified.
[TRACE] 10:34:15.872 shell.go:FileContent(C:\Users\Luke\Downloads\test\.git/logs/refs/stash) - 518.5µs
[DEBUG] 10:34:15.872 shell.go:HasFolder:487 → false
[TRACE] 10:34:15.872 shell.go:HasFolder(C:\Users\Luke\Downloads\test\.git/worktrees) - 0s
[TRACE] 10:34:15.872 shell.go:Shell() - 0s
[DEBUG] 10:34:15.872 text.go:Render:70 → Rendering template: plain
[DEBUG] 10:34:15.872 text.go:Render:70 → Rendering template: plain
[DEBUG] 10:34:15.872 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:34:15.872 text.go:Render:70 → Rendering template: {{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}
[TRACE] 10:34:15.872 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.872 text.go:Render:70 → Rendering template: {{ if gt .Ahead 0 }}#B388FF{{ end }}
[TRACE] 10:34:15.872 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.872 text.go:Render:70 → Rendering template: {{ if gt .Behind 0 }}#B388FF{{ end }}
[TRACE] 10:34:15.872 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.872 text.go:Render:70 → Rendering template: diamond
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Flags() - 0s
[TRACE] 10:34:15.873 shell.go:Pwd() - 0s
[TRACE] 10:34:15.873 shell.go:Flags() - 0s
[TRACE] 10:34:15.873 shell.go:Pwd() - 0s
[DEBUG] 10:34:15.873 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.873 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.873 segment.go:SetEnabled:497 → Segment: Executiontime
[DEBUG] 10:34:15.873 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.873 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.873 properties.go:GetBool:22 → always_enabled: false
[TRACE] 10:34:15.873 shell.go:ExecutionTime() - 0s
[DEBUG] 10:34:15.873 segment.go:SetEnabled:497 → Segment: Session
[DEBUG] 10:34:15.873 properties.go:GetFloat64:34 → threshold: 3000.000000
[DEBUG] 10:34:15.873 shell.go:Getenv:392 → NO DATA
[TRACE] 10:34:15.873 shell.go:Getenv(SSH_CONNECTION) - 0s
[DEBUG] 10:34:15.873 shell.go:Getenv:392 → NO DATA
[TRACE] 10:34:15.873 shell.go:Getenv(SSH_CLIENT) - 0s
[TRACE] 10:34:15.873 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.873 text.go:Render:70 → Rendering template:   {{ if .SSHSession }} {{ end }}{{ .UserName }}<transparent> / </>{{ .HostName }}<transparent> </>
[TRACE] 10:34:15.873 shell.go:TemplateCache() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[DEBUG] 10:34:15.873 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:34:15.873 text.go:Render:70 → Rendering template: plain
[DEBUG] 10:34:15.873 shell_windows.go:TerminalWidth:109 → terminal width: 136
[TRACE] 10:34:15.873 shell_windows.go:TerminalWidth() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Flags() - 0s
[DEBUG] 10:34:15.873 properties.go:GetString:28 → {{ .Code }}
[TRACE] 10:34:15.873 shell.go:Pwd() - 0s
[DEBUG] 10:34:15.873 shell_windows.go:56 → C:\Users\Luke
[TRACE] 10:34:15.873 shell.go:GOOS() - 0s
[DEBUG] 10:34:15.873 segment.go:SetEnabled:497 → Segment: Status
[TRACE] 10:34:15.873 shell.go:StatusCodes() - 0s
[DEBUG] 10:34:15.873 text.go:Render:70 → Rendering template: {{ .Code }}
[TRACE] 10:34:15.873 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.873 properties.go:GetBool:22 → always_enabled: true
[TRACE] 10:34:15.873 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.873 text.go:Render:70 → Rendering template: ❯
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[DEBUG] 10:34:15.873 shell.go:Getenv:392 → NO DATA
[TRACE] 10:34:15.873 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 10:34:15.873 text.go:Render:70 → Rendering template: {{ if gt .Code 0 }}#E06C75{{ end }}
[TRACE] 10:34:15.873 shell.go:TemplateCache() - 0s
[DEBUG] 10:34:15.873 text.go:Render:70 → Rendering template: plain
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Flags() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Pwd() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[TRACE] 10:34:15.873 shell.go:Shell() - 0s
[DEBUG] 10:34:15.873 shell.go:Getenv:392 → C:\Users\Luke\AppData\Local
[TRACE] 10:34:15.873 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 10:34:15.873 shell_windows.go:CachePath() - 0s
[TRACE] 10:34:15.873 shell.go:Flags() - 0s
```



Discussion:
@lpke fix incoming, it seems we did not end the transparent override. Changing transparent to any color also solves the issue in the meantime.
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a [discussion](https://github.com/JanDeDobbeleer/oh-my-posh/discussions/new?category=troubleshoot) first, complete the body with all the details necessary to reproduce, and mention this issue as reference.



Patch:
diff --git a/src/ansi/ansi_writer.go b/src/ansi/ansi_writer.go
index 7f1ff9f96945..1d89830f1769 100644
--- a/src/ansi/ansi_writer.go
+++ b/src/ansi/ansi_writer.go
@@ -482,9 +482,6 @@ func (w *Writer) writeColorOverrides(match map[string]string, background string,
 }
 
 func (w *Writer) endColorOverride(position int) int {
-	// pop the last colors from the stack
-	defer w.current.Pop()
-
 	// make sure to reset the colors if needed
 	position += len([]rune(resetStyle.AnchorEnd)) - 1
 
@@ -493,26 +490,36 @@ func (w *Writer) endColorOverride(position int) int {
 		return position
 	}
 
-	// reset colors to previous when we have >= 2 in stack
+	// reset colors to previous when we have more than 1 in stack
 	// as soon as we have  more than 1, we can pop the last one
 	// and print the previous override as it wasn't ended yet
-	if w.current.Len() >= 2 {
+	if w.current.Len() > 1 {
 		fg := w.current.Foreground()
 		bg := w.current.Background()
 
 		w.current.Pop()
 
-		if w.current.Background() != bg {
-			w.writeEscapedAnsiString(fmt.Sprintf(colorise, w.current.Background()))
+		previousBg := w.current.Background()
+		previousFg := w.current.Foreground()
+
+		if w.transparent {
+			w.writeEscapedAnsiString(transparentEnd)
 		}
 
-		if w.current.Foreground() != fg {
-			w.writeEscapedAnsiString(fmt.Sprintf(colorise, w.current.Foreground()))
+		if previousBg != bg {
+			w.writeEscapedAnsiString(fmt.Sprintf(colorise, previousBg))
+		}
+
+		if previousFg != fg {
+			w.writeEscapedAnsiString(fmt.Sprintf(colorise, previousFg))
 		}
 
 		return position
 	}
 
+	// pop the last colors from the stack
+	defer w.current.Pop()
+
 	// do not reset when colors are identical
 	if w.current.Background() == w.background && w.current.Foreground() == w.foreground {
 		return position


Test patch:
diff --git a/src/ansi/ansi_writer_test.go b/src/ansi/ansi_writer_test.go
index d344ba546c45..a4584c8be4fd 100644
--- a/src/ansi/ansi_writer_test.go
+++ b/src/ansi/ansi_writer_test.go
@@ -200,6 +200,12 @@ func TestWriteANSIColors(t *testing.T) {
 			Expected: "\x1b[47m\x1b[30mhello, \x1b[31mworld, \x1b[37mrabbit\x1b[31m hello\x1b[0m",
 			Colors:   &Colors{Foreground: "black", Background: "white"},
 		},
+		{
+			Case:     "Transparent override",
+			Input:    "home<transparent> / </>code<transparent> / </>src ",
+			Expected: "\x1b[47m\x1b[30mhome\x1b[0m\x1b[37;49m\x1b[7m / \x1b[27m\x1b[47m\x1b[30mcode\x1b[0m\x1b[37;49m\x1b[7m / \x1b[27m\x1b[47m\x1b[30msrc \x1b[0m",
+			Colors:   &Colors{Foreground: "black", Background: "white"},
+		},
 	}
 
 	for _, tc := range cases {