JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.42k stars 2.39k forks source link

Transparent Powerline Symbols? #4613

Closed GavinOsborn closed 10 months ago

GavinOsborn commented 10 months ago

Code of Conduct

What happened?

In #2826 I introduced the cloud-context theme - it's been a while since I updated OMP but after a clean install I noticed a bunch of things no longer working largely due (I think) to the NerdFont updates - I'm addressing most things in #4612.

I prefer a transparent powerline but I know that's not true for everyone so I leveraged your palette feature to make it easy to configure as you prefer but since the update the powerline symbol transparency is no longer working.

image

(Notice the white half-circles that are supposed to be transparent inline with the segment background color)

I'm unsure how to resolve this - is this a bug? Is there a new way of doing this?

Theme

Minimal repro taken from the cloud-context theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "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",
    "cloud-text-amazon": "#4285F4",
    "cloud-text-azure": "#4285F4",
    "cloud-text-gcp": "#4285F4",
    "error-background": "#dd0033",
    "error-text": "#242424",
    "git-text": "#238636",
    "kubernetes-text": "#FFBB00",
    "symbol-color": "#ffffff",
    "timer-text": "#dd0033"
  },
  "blocks": [
    {
      "alignment": "left",
      "newline": false,
      "segments": [
        {
          "background": "p:background-color",
          "foreground": "p:timer-text",
          "properties": {
            "time_format": "15:04:05"
          },
          "style": "powerline",
          "powerline_symbol": "",
          "template": " <p:symbol-color>\udb80\udd5f</> {{ dateInZone .Format .CurrentDate \"UTC\" }} ",
          "type": "time"
        },
        {
          "background": "p:background-color",
          "foreground": "p:git-text",
          "style": "powerline",
          "powerline_symbol": "\ue0b4",
          "template": " <p:symbol-color>\uF408</> {{ .RepoName }}",
          "type": "git"
        }
      ],
      "type": "prompt"
    }
  ]
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

bash, powershell

Log output

󰅟 03:38:16   oh-my-poshoh-my-posh.exe debug --plain

Version: 19.4.0

Shell: powershell (5.1.22621.2506)

Prompt:

 󰅟 03:38:44   oh-my-posh

Segments:

ConsoleTitle(true)                        -   0 ms
Time(true)                                -   0 ms
Git(true)                                 -   2 ms

Run duration: 9.4232ms

Cache path: C:\Users\gav\AppData\Local\oh-my-posh

Config path: C:\Users\gav\code\gav\oh-my-posh\themes\repro.omp.json

Logs:

[DEBUG] 14:38:44.234 shell.go:Getenv:399 → NO DATA
[TRACE] 14:38:44.234 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 14:38:44.234 shell.go:Getenv:399 → C:\Users\gav\AppData\Local
[TRACE] 14:38:44.234 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 14:38:44.234 shell_windows.go:CachePath() - 0s
[DEBUG] 14:38:44.235 shell.go:Getenv:399 → C:\Users\gav\code\gav\oh-my-posh\themes\repro.omp.json
[TRACE] 14:38:44.235 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 14:38:44.235 shell.go:Shell:662 → no shell name provided in flags, trying to detect it
[DEBUG] 14:38:44.239 shell.go:Shell:670 → process name: powershell.exe
[TRACE] 14:38:44.239 shell.go:Shell() - 4.2041ms
[TRACE] 14:38:44.239 shell.go:resolveConfigPath() - 4.2041ms
[TRACE] 14:38:44.239 shell.go:Init() - 4.7253ms
[TRACE] 14:38:44.239 shell.go:Flags() - 0s
[TRACE] 14:38:44.240 config.go:loadConfig() - 519.2µs
[TRACE] 14:38:44.240 shell.go:Flags() - 0s
[DEBUG] 14:38:44.240 shell.go:Getenv:399 → NO DATA
[TRACE] 14:38:44.240 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 14:38:44.240 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.240 shell_windows.go:WindowsRegistryKeyValue:215 → ColorizationColor(DWORD): 0xC40063B1
[TRACE] 14:38:44.240 shell.go:Shell() - 0s
[DEBUG] 14:38:44.240 shell.go:Getenv:399 → 5.1.22621.2506
[TRACE] 14:38:44.240 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 14:38:44.240 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 14:38:44.240 text.go:Render:70 → Rendering 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 }}
[TRACE] 14:38:44.240 shell_windows.go:Root() - 0s
[TRACE] 14:38:44.240 shell.go:Shell() - 0s
[TRACE] 14:38:44.240 shell.go:StatusCodes() - 0s
[TRACE] 14:38:44.240 shell_windows.go:IsWsl() - 0s
[DEBUG] 14:38:44.240 shell.go:TemplateCache:843 → environment: [ACSetupSvcPort=23210 ACSvcPort=17532 ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\gav\AppData\Roaming ChocolateyInstall=C:\ProgramData\chocolatey ChocolateyLastPathUpdate=133490831858363777 CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=FRIDAY ComSpec=C:\Windows\system32\cmd.exe CONDA_PROMPT_MODIFIER=False DriverData=C:\Windows\System32\Drivers\DriverData EnableLog=INFO HOMEDRIVE=C: HOMEPATH=\Users\gav LOCALAPPDATA=C:\Users\gav\AppData\Local LOGONSERVER=\\FRIDAY NUMBER_OF_PROCESSORS=24 OneDrive=C:\Users\gav\OneDrive OneDriveConsumer=C:\Users\gav\OneDrive OS=Windows_NT Path=C:\Python312\Scripts\;C:\Python312\;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\oh-my-posh\bin;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\gav\AppData\Local\Microsoft\WindowsApps;;C:\Users\gav\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\gav\AppData\Local\Microsoft\WinGet\Packages\Microsoft.VisualStudioCode.CLI_Microsoft.Winget.Source_8wekyb3d8bbwe\.;C:\Users\gav\.dotnet\tools;C:\Users\gav\AppData\Local\Programs\oh-my-posh\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL POSH_AZURE_ENABLED=False POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=30 POSH_GIT_ENABLED=False POSH_INSTALLER=winget POSH_PID=6532 POSH_SHELL_VERSION=5.1.22621.2506 POSH_THEME=C:\Users\gav\code\gav\oh-my-posh\themes\repro.omp.json POSH_THEMES_PATH=C:\Users\gav\AppData\Local\Programs\oh-my-posh\themes POWERLINE_COMMAND=oh-my-posh 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\gav\OneDrive\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell PUBLIC=C:\Users\Public RlsSvcPort=22112 SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\gav\AppData\Local\Temp TMP=C:\Users\gav\AppData\Local\Temp USERDOMAIN=FRIDAY USERDOMAIN_ROAMINGPROFILE=FRIDAY USERNAME=gav USERPROFILE=C:\Users\gav windir=C:\Windows WSLENV=WT_SESSION:WT_PROFILE_ID: WT_PROFILE_ID={61c54bbd-c2c6-5271-96e7-009a87ff44bf} WT_SESSION=2ce643a9-1e11-467a-9246-24c203c17226]
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.240 shell.go:Pwd:429 → C:\Users\gav\code\gav\oh-my-posh
[TRACE] 14:38:44.240 shell.go:Pwd() - 0s
[DEBUG] 14:38:44.240 shell_windows.go:56 → C:\Users\gav
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.240 shell.go:User:564 → gav
[TRACE] 14:38:44.240 shell.go:User() - 0s
[DEBUG] 14:38:44.240 shell.go:Host:576 → Friday
[TRACE] 14:38:44.240 shell.go:Host() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.240 shell.go:Getenv:399 → NO DATA
[TRACE] 14:38:44.240 shell.go:Getenv(SHLVL) - 0s
[TRACE] 14:38:44.240 shell.go:TemplateCache() - 531.4µs
[DEBUG] 14:38:44.240 shell.go:Getenv:399 → 30
[TRACE] 14:38:44.240 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 14:38:44.240 shell.go:Getenv:399 → 1
[TRACE] 14:38:44.240 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 14:38:44.240 shell.go:Flags() - 0s
[TRACE] 14:38:44.240 shell.go:Flags() - 0s
[TRACE] 14:38:44.240 shell.go:Shell() - 0s
[TRACE] 14:38:44.240 shell.go:Shell() - 0s
[TRACE] 14:38:44.240 shell.go:Flags() - 0s
[TRACE] 14:38:44.240 shell.go:Pwd() - 0s
[DEBUG] 14:38:44.240 shell_windows.go:56 → C:\Users\gav
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.240 segment.go:SetEnabled:512 → Segment: Git
[TRACE] 14:38:44.240 shell.go:Flags() - 0s
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[TRACE] 14:38:44.240 shell.go:Pwd() - 0s
[DEBUG] 14:38:44.240 shell_windows.go:56 → C:\Users\gav
[TRACE] 14:38:44.240 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.240 segment.go:SetEnabled:512 → Segment: Time
[DEBUG] 14:38:44.240 properties.go:GetString:28 → 15:04:05
[TRACE] 14:38:44.240 shell.go:TemplateCache() - 0s
[DEBUG] 14:38:44.242 shell.go:CommandPath:615 → C:\Program Files\Git\cmd\git.exe
[TRACE] 14:38:44.242 shell.go:CommandPath(git.exe) - 2.085ms
[TRACE] 14:38:44.242 shell.go:HasCommand(git.exe) - 2.085ms
[TRACE] 14:38:44.242 shell.go:Pwd() - 0s
[TRACE] 14:38:44.242 shell.go:HasParentFilePath(.git) - 0s
[DEBUG] 14:38:44.242 properties.go:GetStringArray:52 → exclude_folders: []
[DEBUG] 14:38:44.242 shell_windows.go:56 → C:\Users\gav
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.242 properties.go:GetBool:22 → fetch_user: false
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.242 shell.go:Getenv:399 → NO DATA
[TRACE] 14:38:44.242 shell.go:Getenv(POSH_GIT_STATUS) - 0s
[DEBUG] 14:38:44.242 properties.go:GetBool:22 → fetch_status: false
[DEBUG] 14:38:44.242 properties.go:GetStringArray:52 → ignore_status: []
[DEBUG] 14:38:44.242 shell_windows.go:56 → C:\Users\gav
[TRACE] 14:38:44.242 shell.go:GOOS() - 0s
[DEBUG] 14:38:44.242 shell.go:FileContent:538 ↓
    ref: refs/heads/theme/cloud-context-fix

[TRACE] 14:38:44.242 shell.go:FileContent(C:\Users\gav\code\gav\oh-my-posh\.git/HEAD) - 0s
[DEBUG] 14:38:44.242 properties.go:GetString:28 → 
[DEBUG] 14:38:44.242 properties.go:GetInt:40 → branch_max_length: 0
[DEBUG] 14:38:44.242 properties.go:GetBool:22 → fetch_upstream_icon: false
[TRACE] 14:38:44.242 shell.go:TemplateCache() - 0s
[DEBUG] 14:38:44.242 text.go:Render:70 → Rendering template:  <p:symbol-color></> {{ .RepoName }}
[DEBUG] 14:38:44.242 text.go:Render:70 → Rendering template:  <p:symbol-color>󰅟</> {{ dateInZone .Format .CurrentDate "UTC" }}
[TRACE] 14:38:44.244 shell.go:TemplateCache() - 0s
[TRACE] 14:38:44.244 shell.go:Shell() - 0s
[TRACE] 14:38:44.244 shell.go:TemplateCache() - 0s
[TRACE] 14:38:44.244 shell.go:Shell() - 0s
[DEBUG] 14:38:44.244 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:38:44.244 text.go:Render:70 → Rendering template: powerline
[TRACE] 14:38:44.244 shell.go:Shell() - 0s
[TRACE] 14:38:44.244 shell.go:Shell() - 0s
[TRACE] 14:38:44.244 shell.go:Flags() - 0s
[TRACE] 14:38:44.244 shell.go:Shell() - 0s
[TRACE] 14:38:44.244 shell.go:Shell() - 0s
[DEBUG] 14:38:44.244 shell.go:Getenv:399 → C:\Users\gav\AppData\Local
[TRACE] 14:38:44.244 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 14:38:44.244 shell_windows.go:CachePath() - 0s
[TRACE] 14:38:44.244 shell.go:Flags() - 0s
JanDeDobbeleer commented 10 months ago

@GavinOsborn that bug was fixed in v19.5.1.

github-actions[bot] commented 5 months ago

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 first, complete the body with all the details necessary to reproduce, and mention this issue as reference.