Closed mfedatto closed 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?
{
"$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"
}
]
}
]
}
@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.
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.
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
andexecutiontime
segment is using foreground color#1a2a33
, butexecutiontime
is rendered with#6a6a6a
.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