Closed thanhph111 closed 2 years ago
@thanhph111 this syntax is actually not supported as we do not loop the colors:
"background": "parentBackground",
"leading_diamond": "<transparent,background>\uE0B0</>",
it means in the diamond, background
translates to parentBackground
which isn't resolved to the actual color and falls back to the current bg (which is correct, so it ends up being a full coloured block).
Changing it to this fixes the issue:
"background": "parentBackground",
"leading_diamond": "<transparent,parentBackground>\uE0B0</>",
I'll see what I can do ;-)
Sorry for picking a special example, let me take another one here:
{
"blocks": [
{
"alignment": "left",
"newline": false,
"type": "prompt",
"segments": [
{
"type": "time",
"style": "diamond",
"leading_diamond": "\uE0B6",
"background": "red",
"foreground": "lightWhite"
},
{
"type": "session",
"style": "powerline",
"powerline_symbol": "\uE0B4",
"foreground": "parentForeground",
"background": "yellow",
"properties": {
"template": "{{ .ComputerName }}"
}
},
{
"type": "shell",
"style": "powerline",
"foreground": "parentForeground",
"background": "parentBackground",
"properties": {
"prefix": "● "
}
},
{
"type": "path",
"style": "powerline",
"powerline_symbol": "\uE0B4",
"foreground": "lightWhite",
"background": "blue"
}
]
}
]
}
And we will have:
As you said, we don't loop to expand values so only first parentForeground
works, that's correct. However, the parentBackground
doesn't seem to expand either. It lets the last symbol fall back to default background color. I don't know if it was intended or not.
Changing back to specific color works perfectly:
- "background": "parentBackground",
+ "background": "yellow",
- "background": "parentBackground",
+ "background": "green",
@thanhph111 the last example has one thing which isn't supported and that's a grandparent. But I'm working on resolving the issue as we could in theory support it.
Thanks a lot. I'm not familiar with Go so I'm not really useful with this, but if you need anything more I'd be happy to help. And yeah, the "grandparent" feature should be in another issue.
@thanhph111 I fixed it, but it needs proper testing. This part of the codebase isn't as easy, but I was able to make it simpler in the process.
Glad to hear that, thank you. BTW, just curious, I've seen a high frequency of releases, how do you decide which version to choose for your next release?
Every change gets pushed, versions are generated automatically.
So we aren't following semantic versioning?
@thanhph111 yes we are, fully automated via conventional commits.
@JanDeDobbeleer Does version 6.36.1 include this issue? Looks like it's still broken somehow.
Yes it does:
In your sample the shell segment doesn't have a powerline_symbol
so we obviously do not print anything. That was actually a bug, now we do it correctly.
Sorry for disturbing you again. I try to reproduce this old settings on this new release style but no luck. Here my config:
{
"blocks": [
{
"alignment": "left",
"newline": false,
"type": "prompt",
"segments": [
{
"type": "time",
"style": "diamond",
"leading_diamond": "\ue0b6",
"background": "red",
"foreground": "lightWhite"
},
{
"type": "session",
"style": "powerline",
"powerline_symbol": "\ue0b4",
"foreground": "lightWhite",
"background": "yellow",
"properties": {
"template": "{{ .ComputerName }}"
}
},
{
"type": "shell",
"style": "powerline",
"foreground": "lightWhite",
"background": "yellow",
"properties": {
"prefix": "● "
}
},
{
"type": "envvar",
"style": "powerline",
"foreground": "lightWhite",
"background": "yellow",
"properties": {
"prefix": "",
"template": "\uf708",
"var_name": "NO_HISTORY"
}
},
{
"type": "path",
"style": "powerline",
"powerline_symbol": "\ue0b4",
"foreground": "lightWhite",
"background": "blue"
}
]
}
]
}
Here are the renders:
I have tried several configurations but none of them are the same as my old ones, they have an extra space between segments.
@JanDeDobbeleer I saw the release, thank you very much, but it doesn't seem to change, do I have to rewrite the config or something?
But it's quite not important, I can live with 6.34.1 for a while, if you feel tired with this issue, we can fix it later, no need to hurry.
I don't feel tired, I did fix it but maybe I did something stupid.
Sorry for that, I've just realized I don't have to put powerline_symbol
to followed segments anymore, that's amazing. Thanks a lot, man. You're brilliant.
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?
background
field toparentBackground
like in my images below.I've been using Oh My Posh from the very beginning, just upgraded from an old version. While it doesn't give me the same depth of control as the PowerShell version did, to be honest, it still makes me very happy. Thank you for creating a great tool.
Theme
What OS are you seeing the problem on?
Linux
Which shell are you using?
bash, powershell
Log output