Closed bozho closed 3 years ago
Strange. Works here:
with:
"background": "#fffb38",
"foreground": "#193549",
"powerline_symbol": "",
"properties": {
"ahead_and_behind_color": "#f26d50",
"ahead_color": "#a3dc89",
"behind_color": "#f17c37",
"local_changes_color": "#f567fa",
"display_stash_count": true,
"display_upstream_icon": true,
"stash_count_icon": " ",
"status_colors_enabled": true,
"display_status": true,
"branch_max_length": 255,
"display_worktree_count": true
},
"style": "powerline",
"type": "git"
I also tried you config and the colors are fine(green when ahead):`
Ah, it looks like ahead_color
is not honoured when the branch is ahead and there are local changes:
Is that by design?
Ah, there's local_ changes_color
, too, which I didn't set, so it defaults to the segment colour.
I'm just used to posh-git
prompt, where branch colours are separate from local working tree colours :)
you can still use posh git => https://ohmyposh.dev/docs/poshgit
I know, I just wanted to be cool with icons and stuff :)
Thank you, closing.
So is there any way to set the color for ahead/behind in git
segment? That's my config:
Colors for staging and working are correct:
but ahead (I suspect it's the same for behind) are not:
Tried setting up local_changes_color
(changes background instead of foreground!) and ahead_and_behind_color
but it doesn't seem to work.
It should be reopned as it still needs fixing.
You need to set "status_colors_enabled": true
. Also, there's a change incoming for the git segment (#1163) that will render this deprecated and you can use (by then) the background_templates
/foreground_templates
logic to color the segment accordingly.
And yes, setting local_changes_color
colors the background as there's also color_background
that defaults to true
.
Correction: local_changes_color
doesn't change anything on its own and adding "status_colors_enabled": true
changes background. Naming of properties seems quite complicated TBH. I would expect status_color_enabled
to simply toggle color customization. false
should make whole git segment rendered with default color ("foreground": "#1ffdf2"
in my case).
@SharakPL these will all go away (silent support, no active support) so that'll be fixed really, really soon. Follow the PR #1163 for more information ;-)
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?
ahead_color
segment setting seems to have no effect. When my branch is ahead (there are thing to push to remote),git
segment colour is the one set inforeground
. I've tried both colour names and hex codes.behind_color
works fine, haven't had a chance to testahead_and_behind_color
yet.Version
oh-my-posh
PS module v5.8.0 in PowerShell5.1
and7.2.0-preview.7
, on Windows 10 Pro,Theme
Here's my
git
segment config:What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Relevant log output
No response