JanDeDobbeleer / oh-my-posh

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

Executiontime foreground color not working properly #4606

Closed mfedatto closed 9 months ago

mfedatto commented 9 months ago

Code of Conduct

What happened?

The foreground color for segments of type executiontime isn't being colorized as expected. It has happened before on another theme I was tweaking and happening again in this case, where I'm writing the theme from scratch. The RAM segment is using foreground color #6a6a6a and executiontime segment is using foreground color #1a2a33, but executiontime is rendered with #6a6a6a.

{
    "type": "sysinfo",
    "style": "plain",
    "foreground": "#6a6a6a",
    "properties": {
        "precision": 1
    },
    "template": "RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1068786176.0) }}GB \u22b1 "
},
{
    "type": "executiontime",
    "style": "plain",
    "foreground": "#1a2a33",
    "properties": {
        "style": "amarillo",
        "threshold": 100
    },
    "template": "{{ .FormattedMs }}"
}

image

Theme

Working on a new theme mfedatto.omp.json

What OS are you seeing the problem on?

Windows, Linux

Which shell are you using?

bash, powershell

Log output

Version: 19.3.0

Shell: pwsh (7.4.0)

Prompt:

⊰ mauricio @ MFedatto-G8K20 ⊱ ⊰ 17:00:02 ⊱ ⊰ CPU 28% | RAM: 19/64GB ⊱                                         ⊰ master ⊱⊰ D:\usr\mauricio\repos\github\mfedatto\mfedatto-omp-theme\src\ ⊱

Segments:

ConsoleTitle(false)                        -   0 ms
Text(true)                                 -   1 ms
Text(false)                                -   1 ms
Text(true)                                 -   0 ms
Time(true)                                 -   1 ms
Sysinfo(true)                              -   1 ms
Sysinfo(true)                              -   0 ms
Executiontime(false)                       -   0 ms
Git(true)                                  -   8 ms
Text(true)                                 -   0 ms

Run duration: 21.111ms

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

Config path: D:\usr\mauricio\repos\github\mfedatto\mfedatto-omp-theme\src\mfedatto.omp.json

Logs:

[DEBUG] 17:00:02.644 shell.go:Getenv:399 → vscode
[TRACE] 17:00:02.644 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 17:00:02.644 shell.go:Getenv:399 → C:\Users\mauricio\AppData\Local
[TRACE] 17:00:02.644 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 17:00:02.645 shell_windows.go:CachePath() - 1.0007ms
[DEBUG] 17:00:02.646 shell.go:Getenv:399 → D:\usr\mauricio\repos\github\mfedatto\mfedatto-omp-theme\src\mfedatto.omp.json[TRACE] 17:00:02.646 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 17:00:02.646 shell.go:Shell:662 → no shell name provided in flags, trying to detect it
[DEBUG] 17:00:02.652 shell.go:Shell:670 → process name: pwsh.exe
[TRACE] 17:00:02.652 shell.go:Shell() - 6.3063ms
[TRACE] 17:00:02.652 shell.go:resolveConfigPath() - 6.3063ms
[TRACE] 17:00:02.652 shell.go:Init() - 8.3069ms
[TRACE] 17:00:02.652 shell.go:Flags() - 0s
[TRACE] 17:00:02.653 config.go:loadConfig() - 1.1015ms
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[DEBUG] 17:00:02.653 shell.go:Getenv:399 → NO DATA
[TRACE] 17:00:02.653 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 17:00:02.653 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.653 shell_windows.go:WindowsRegistryKeyValue:215 → ColorizationColor(DWORD): 0xC4107C10
[TRACE] 17:00:02.653 shell.go:Shell() - 0s
[DEBUG] 17:00:02.653 shell.go:Getenv:399 → 7.4.0
[TRACE] 17:00:02.653 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 17:00:02.653 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 17:00:02.653 text.go:Render:70 → Rendering template:
[DEBUG] 17:00:02.653 shell.go:Getenv:399 → 12
[TRACE] 17:00:02.653 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 17:00:02.653 shell.go:Getenv:399 → 1
[TRACE] 17:00:02.653 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[TRACE] 17:00:02.653 shell.go:Shell() - 0s
[TRACE] 17:00:02.653 shell.go:Shell() - 0s
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[DEBUG] 17:00:02.653 properties.go:GetInt:40 → precision: 1
[TRACE] 17:00:02.653 shell.go:Flags() - 0s
[DEBUG] 17:00:02.653 shell.go:Pwd:429 → D:\usr\mauricio\repos\github\mfedatto\mfedatto-omp-theme\src
[TRACE] 17:00:02.653 shell.go:Pwd() - 43.9µs
[DEBUG] 17:00:02.653 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.653 segment.go:SetEnabled:512 → Segment: Executiontime
[TRACE] 17:00:02.653 shell.go:Pwd() - 0s
[DEBUG] 17:00:02.653 properties.go:GetBool:22 → always_enabled: false
[TRACE] 17:00:02.653 shell.go:ExecutionTime() - 0s
[DEBUG] 17:00:02.653 properties.go:GetFloat64:34 → threshold: 100.000000
[TRACE] 17:00:02.653 shell.go:Pwd() - 0s
[DEBUG] 17:00:02.653 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.653 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.653 segment.go:SetEnabled:512 → Segment: Text
[TRACE] 17:00:02.653 shell_windows.go:Root() - 0s
[TRACE] 17:00:02.653 shell.go:Pwd() - 0s
[TRACE] 17:00:02.653 shell.go:Shell() - 0s
[TRACE] 17:00:02.653 shell.go:StatusCodes() - 0s
[TRACE] 17:00:02.653 shell_windows.go:IsWsl() - 0s
[DEBUG] 17:00:02.654 properties.go:GetInt:40 → precision: 1
[TRACE] 17:00:02.654 shell.go:Pwd() - 0s
[TRACE] 17:00:02.654 shell.go:Pwd() - 0s
[DEBUG] 17:00:02.654 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.654 shell_windows.go:56 → C:\Users\mauricio
[DEBUG] 17:00:02.654 segment.go:SetEnabled:512 → Segment: Text
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.654 segment.go:SetEnabled:512 → Segment: Text
[DEBUG] 17:00:02.654 shell.go:TemplateCache:843 → environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\mauricio\AppData\Roaming CHROME_CRASHPAD_PIPE_NAME=\\.\pipe\crashpad_21132_YAWCJEPIJOEFDOGI CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=MFEDATTO-G8K20 ComSpec=C:\Windows\system32\cmd.exe DriverData=C:\Windows\System32\Drivers\DriverData HOMEDRIVE=C: HOMEPATH=\Users\mauricio LOCALAPPDATA=C:\Users\mauricio\AppData\Local LOGONSERVER=\\MFEDATTO-G8K20 NUMBER_OF_PROCESSORS=8 OneDrive=D:\usr\mauricio\cloud\onedrive OneDriveConsumer=D:\usr\mauricio\cloud\onedrive ORIGINAL_XDG_CURRENT_DESKTOP=undefined OS=Windows_NT Path=C:\Program Files\PowerShell\7;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\Microsoft VS Code\bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\PowerShell\7\;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Vagrant\bin;C:\Users\mauricio\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\mauricio\AppData\Local\Programs\Python\Python310\;C:\Users\mauricio\AppData\Local\Microsoft\WindowsApps;C:\Users\mauricio\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\mauricio\.dotnet\tools;C:\Users\mauricio\AppData\Local\Programs\oh-my-posh\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL POSH_INSTALLER=manual POSH_THEMES_PATH=C:\Users\mauricio\AppData\Local\Programs\oh-my-posh\themes POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Pro PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 13, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=9e0d ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=D:\usr\mauricio\cloud\onedrive\Documentos\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 SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\mauricio\AppData\Local\Temp TMP=C:\Users\mauricio\AppData\Local\Temp USERDOMAIN=MFEDATTO-G8K20 USERDOMAIN_ROAMINGPROFILE=MFEDATTO-G8K20 USERNAME=mauricio USERPROFILE=C:\Users\mauricio VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\ windir=C:\Windows CONDA_PROMPT_MODIFIER=False POSH_AZURE_ENABLED=False POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=12 POSH_GIT_ENABLED=False POSH_PID=22536 POSH_SHELL_VERSION=7.4.0 POSH_THEME=D:\usr\mauricio\repos\github\mfedatto\mfedatto-omp-theme\src\mfedatto.omp.json POWERLINE_COMMAND=oh-my-posh PROMPT=$P$G WSLENV=WT_SESSION:WT_PROFILE_ID: WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} WT_SESSION=101ccd79-12e4-434a-8991-6e5c28286547 TERM_PROGRAM=vscode TERM_PROGRAM_VERSION=1.85.1 LANG=en_US.UTF-8 COLORTERM=truecolor GIT_ASKPASS=c:\Program Files\Microsoft VS Code\resources\app\extensions\git\dist\askpass.sh VSCODE_GIT_ASKPASS_NODE=C:\Program Files\Microsoft VS Code\Code.exe VSCODE_GIT_ASKPASS_EXTRA_ARGS=--ms-enable-electron-run-as-node VSCODE_GIT_ASKPASS_MAIN=c:\Program Files\Microsoft VS Code\resources\app\extensions\git\dist\askpass-main.js VSCODE_GIT_IPC_HANDLE=\\.\pipe\vscode-git-90471c2b71-sock VSCODE_INJECTION=1]    
[DEBUG] 17:00:02.654 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.654 segment.go:SetEnabled:512 → Segment: Sysinfo
[TRACE] 17:00:02.654 shell.go:Pwd() - 0s
[DEBUG] 17:00:02.654 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[TRACE] 17:00:02.654 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.655 shell.go:User:564 → mauricio
[TRACE] 17:00:02.655 shell.go:User() - 0s
[DEBUG] 17:00:02.655 shell.go:Host:576 → MFedatto-G8K20
[TRACE] 17:00:02.655 shell.go:Host() - 48.4µs
[TRACE] 17:00:02.655 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.655 shell.go:Getenv:399 → NO DATA
[TRACE] 17:00:02.655 shell.go:Getenv(SHLVL) - 0s
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 1.4393ms
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 1.4393ms
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 553.9µs
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 553.9µs
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 553.9µs
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 553.9µs
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: ⊰
[TRACE] 17:00:02.655 shell.go:Shell() - 0s
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: ⊰ {{ .CurrentDate | date .Format }} ⊱
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: ⊰ CPU {{ round .PhysicalPercentUsed .Precision }}% |        
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1068786176.0) }}GB ⊱
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: {{ .UserName }} @ {{ if .WSL }}WSL {{ end }}{{ .HostName }} 
⊱
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: {{ if .Root }}◆ {{ end }}
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.655 shell.go:Shell() - 0s
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.655 shell.go:Shell() - 0s
[TRACE] 17:00:02.655 shell.go:Shell() - 0s
[TRACE] 17:00:02.655 shell.go:Shell() - 0s
[TRACE] 17:00:02.655 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.655 shell.go:Shell() - 0s
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: plain
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: plain
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: plain
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: plain
[DEBUG] 17:00:02.655 text.go:Render:70 → Rendering template: plain
[DEBUG] 17:00:02.656 text.go:Render:70 → Rendering template: plain
[DEBUG] 17:00:02.656 text.go:Render:70 → Rendering template: plain
[TRACE] 17:00:02.656 shell.go:Shell() - 0s
[TRACE] 17:00:02.656 shell.go:Shell() - 0s
[TRACE] 17:00:02.656 shell.go:Shell() - 0s
[TRACE] 17:00:02.656 shell.go:Flags() - 0s
[TRACE] 17:00:02.656 shell.go:Pwd() - 0s
[DEBUG] 17:00:02.656 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.656 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.656 segment.go:SetEnabled:512 → Segment: Git
[TRACE] 17:00:02.656 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.664 shell.go:CommandPath:615 → C:\Program Files\Git\cmd\git.exe
[TRACE] 17:00:02.664 shell.go:CommandPath(git.exe) - 7.5828ms
[TRACE] 17:00:02.664 shell.go:HasCommand(git.exe) - 7.5828ms
[TRACE] 17:00:02.664 shell.go:Pwd() - 0s
[TRACE] 17:00:02.664 shell.go:HasParentFilePath(.git) - 0s
[DEBUG] 17:00:02.664 properties.go:GetStringArray:52 → exclude_folders: []
[DEBUG] 17:00:02.664 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.664 properties.go:GetBool:22 → fetch_user: false
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.664 shell.go:Getenv:399 → NO DATA
[TRACE] 17:00:02.664 shell.go:Getenv(POSH_GIT_STATUS) - 0s
[DEBUG] 17:00:02.664 properties.go:GetBool:22 → fetch_status: false
[DEBUG] 17:00:02.664 properties.go:GetStringArray:52 → ignore_status: []
[DEBUG] 17:00:02.664 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.664 shell.go:FileContent:538 ↓
    ref: refs/heads/master

[TRACE] 17:00:02.664 shell.go:FileContent(D:\usr\mauricio\repos\github\mfedatto\mfedatto-omp-theme\.git/HEAD) - 542.2µs  
[DEBUG] 17:00:02.664 properties.go:GetString:28 → 
[DEBUG] 17:00:02.664 properties.go:GetInt:40 → branch_max_length: 0
[DEBUG] 17:00:02.664 properties.go:GetBool:22 → fetch_upstream_icon: false
[TRACE] 17:00:02.664 shell.go:TemplateCache() - 0s
[DEBUG] 17:00:02.664 text.go:Render:70 → Rendering template:  ⊰ {{ .HEAD }} ⊱
[TRACE] 17:00:02.664 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.664 shell.go:Shell() - 0s
[DEBUG] 17:00:02.664 text.go:Render:70 → Rendering template: plain
[TRACE] 17:00:02.664 shell.go:Shell() - 0s
[DEBUG] 17:00:02.664 shell_windows.go:TerminalWidth:109 → terminal width: 121
[TRACE] 17:00:02.664 shell_windows.go:TerminalWidth() - 0s
[TRACE] 17:00:02.664 shell.go:Shell() - 0s
[TRACE] 17:00:02.664 shell.go:Shell() - 0s
[TRACE] 17:00:02.664 shell.go:Shell() - 0s
[TRACE] 17:00:02.664 shell.go:Flags() - 0s
[TRACE] 17:00:02.664 shell.go:Pwd() - 0s
[DEBUG] 17:00:02.664 shell_windows.go:56 → C:\Users\mauricio
[TRACE] 17:00:02.664 shell.go:GOOS() - 0s
[DEBUG] 17:00:02.664 segment.go:SetEnabled:512 → Segment: Text
[TRACE] 17:00:02.664 shell.go:TemplateCache() - 0s
[DEBUG] 17:00:02.664 text.go:Render:70 → Rendering template: ⊰ {{ .PWD }}\ ⊱
[TRACE] 17:00:02.665 shell.go:TemplateCache() - 0s
[TRACE] 17:00:02.665 shell.go:Shell() - 0s
[DEBUG] 17:00:02.665 shell.go:Getenv:399 → vscode
[TRACE] 17:00:02.665 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 17:00:02.665 text.go:Render:70 → Rendering template: plain
[TRACE] 17:00:02.665 shell.go:Shell() - 0s
[TRACE] 17:00:02.665 shell.go:Shell() - 0s
[TRACE] 17:00:02.665 shell.go:Shell() - 0s
[DEBUG] 17:00:02.665 shell.go:Getenv:399 → C:\Users\mauricio\AppData\Local
[TRACE] 17:00:02.665 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 17:00:02.665 shell_windows.go:CachePath() - 0s
[TRACE] 17:00:02.665 shell.go:Flags() - 0s
JanDeDobbeleer commented 9 months ago

@mfedatto I can't reproduce this when I create a config with only those two segments as they do render correctly every time. Can you share the full configuration?

image
mfedatto commented 9 months ago
{
    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
    "final_space": true,
    "version": 2,
    "blocks": [
        {
            "type": "prompt",
            "alignment": "left",
            "segments": [
                {
                    "type": "text",
                    "style": "plain",
                    "foreground": "#ffe500",
                    "template": "\u22b0 "
                },
                {
                    "type": "text",
                    "style": "plain",
                    "foreground": "#00e5ff",
                    "template": "{{ if .Root }}\u25c6 {{ end }}"
                },
                {
                    "type": "text",
                    "style": "plain",
                    "foreground": "#ffe500",
                    "template": "{{ .UserName }} @ {{ if .WSL }}WSL {{ end }}{{ .HostName }} \u22b1 "
                },
                {
                    "type": "time",
                    "style": "plain",
                    "foreground": "#009999",
                    "properties": {
                        "time_format": "15:04:05"
                    },
                    "template": "\u22b0 {{ .CurrentDate | date .Format }} \u22b1 "
                },
                {
                    "type": "sysinfo",
                    "style": "plain",
                    "foreground": "#6a6a6a",
                    "properties": {
                        "precision": 1
                    },
                    "template": "\u22b0 CPU {{ round .PhysicalPercentUsed .Precision }}% | "
                },
                {
                    "type": "sysinfo",
                    "style": "plain",
                    "foreground": "#6a6a6a",
                    "properties": {
                        "precision": 1
                    },
                    "template": "RAM: {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1068786176.0) }}GB \u22b1 "
                },
                {
                    "type": "executiontime",
                    "style": "plain",
                    "foreground": "#1a2a33",
                    "properties": {
                        "style": "amarillo",
                        "threshold": 100
                    },
                    "template": "{{ .FormattedMs }}"
                }
            ]
        },
        {
            "type": "prompt",
            "alignment": "right",
            "segments": [
                {
                    "type": "git",
                    "style": "plain",
                    "powerline_symbol": ":",
                    "foreground": "#9c27b0",
                    "template": " \u22b0 {{ .HEAD }} \u22b1"
                }
            ]
        },
        {
            "type": "prompt",
            "newline": true,
            "alignment": "left",
            "segments": [
                {
                    "type": "text",
                    "style": "plain",
                    "template": "\u22b0 {{ .PWD }}\\ \u22b1",
                    "foreground": "#20ffa6"
                }
            ]
        }
    ]
}
JanDeDobbeleer commented 9 months ago

@mfedatto I can't reproduce this at all on my machine using latest. Updating "could", but should fix that as there's no contextual logic here. It either prints this correctly all the time or doesn't.

github-actions[bot] commented 4 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.