oh-my-posh: Powerline symbols not rendered when text value is empty
Code of Conduct
- I agree to follow this project’s Code of Conduct
What happened?
Can’t say when, but my prompt got a bit broken by one of the updates. I have the following segment:
{
"background": "#d3d7cf",
"foreground": "#000000",
"invert_powerline": true,
"powerline_symbol": "",
"properties": {
"prefix": "",
"postfix": "",
"text": ""
},
"style": "powerline",
"type":"text"
},
{
"background": "#d3d7cf",
"foreground": "#000000",
"invert_powerline": true,
"leading_diamond": "",
"properties": {
"prefix": "",
"postfix": " "
},
"style": "diamond",
"type": "time"
}
It was working as expected before showing time like this:

Now it looks like this:

It looks like the powerline symbol is not rendered when the text is empty. When I set it to a space " ", it works but adds fair amount of space:

I know that you’ll probably say that I should use “leading_diamond” property, but that does not produce the effect I’m going for. At first I thought it did:

But well…it doesn’t 😉

Version
5.16.2
Theme
Powerline10k_rainbow with minor modifications
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Relevant log output
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (9 by maintainers)
Commits related to this issue
- fix: clear parent colors after block rendering relates to #1137 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 3 years ago
- fix: clear parent colors after block rendering relates to #1137 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 3 years ago
should be fixed by https://github.com/JanDeDobbeleer/oh-my-posh/pull/1134 keep your template as before and it will work once the pull is merged.
@mwasowski here you go, diamond is what you want all the way down 😉
Ah, I have an issue with reading and understanding apparently 😄 You wrote I can use background everywhere 🤦♂️
Thanks again!
@mwasowski when the change above lands, this seems to work like a charm:
It’s related to this change(text segment not rendered if empty) https://github.com/JanDeDobbeleer/oh-my-posh/commit/d0816773a51c0ab62016d91294902fe7bd38ed91 Your sample works if I revert it
this works for example:
@JanDeDobbeleer Yes. I closed it before testing but 5.16.3 did not fix this for me. So with no preceding segment it looks like this:
And with like this.

@mwasowski that’s probably the issue @lnu found and what’s supposedly going to be fixed here.