Palette color of "transparent" set as segment foreground doesn't behave as expected #5790
Closed
1 task done
Labels
🐛 bug
Something isn't working
Code of Conduct
What happened?
Whilst I was changing my oh-my-posh config to use palette colors, I noticed some curious behaviour when setting the segment foreground color to point to a palette color with value of
transparent
. The background color of the segment turned grey even though it was explicitly set to a different value in the config.I can reproduce this issue with the provided config on the
main
branch (bbbc8c5). I expected the resulting output to be some text on a green background; however the actual output is some text on a grey background.I think the bug might be related to this function:
oh-my-posh/src/terminal/writer.go
Lines 595 to 613 in bbbc8c5
When the foreground color is set to
p:text-foreground
,inverted
is false becauseforeground
doesn't get resolved from a palette reference to the final actual value. I'm unsure why exactly does this cause problems, but after some experimenting I wrote a hacky workaround for myself (Nettifani@c77246a) which seems to resolve the issue. I hope the information I have provided is useful in some way :)Theme
What OS are you seeing the problem on?
Linux
Which shell are you using?
bash
Log output
The text was updated successfully, but these errors were encountered: