Skip to content

Instantly share code, notes, and snippets.

@shanselman
Last active March 23, 2025 11:28
Show Gist options
  • Save shanselman/1f69b28bfcc4f7716e49eb5bb34d7b2c to your computer and use it in GitHub Desktop.
Save shanselman/1f69b28bfcc4f7716e49eb5bb34d7b2c to your computer and use it in GitHub Desktop.
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
"segments": [
{
"type": "path",
"style": "diamond",
"powerline_symbol": "",
"invert_powerline": false,
"foreground": "#ffffff",
"background": "#ff479c",
"leading_diamond": "",
"trailing_diamond": "",
"properties": {
"prefix": "  ",
"style": "folder"
}
},
{
"type": "git",
"style": "powerline",
"powerline_symbol": "",
"invert_powerline": false,
"foreground": "#193549",
"background": "#fffb38",
"leading_diamond": "",
"trailing_diamond": "",
"properties": {
"display_status": true,
"display_stash_count": true,
"display_upstream_icon": true
}
},
{
"type": "dotnet",
"style": "powerline",
"powerline_symbol": "",
"invert_powerline": false,
"foreground": "#ffffff",
"background": "#6CA35E",
"leading_diamond": "",
"trailing_diamond": "",
"properties": {
"display_version": true,
"prefix": "  "
}
},
{
"type": "root",
"style": "powerline",
"powerline_symbol": "",
"invert_powerline": false,
"foreground": "#ffffff",
"background": "#ffff66",
"leading_diamond": "",
"trailing_diamond": "",
"properties": null
},
{
"type": "exit",
"style": "powerline",
"powerline_symbol": "",
"invert_powerline": false,
"foreground": "#ffffff",
"background": "#2e9599",
"leading_diamond": "",
"trailing_diamond": "",
"properties": {
"always_enabled": true,
"color_background": true,
"display_exit_code": false,
"error_color": "#f1184c",
"prefix": " "
}
}
]
}
]
}
@alanneves
Copy link

What does the heart icon mean?

@shanselman
Copy link
Author

shanselman commented Mar 10, 2022 via email

@danield20
Copy link

Does this still work? For me it's a bit buggy, I think they migrated all the config options to other formats and when it is migrated automatically it breaks some stuff.

@benjamintemitope
Copy link

Does this still work? For me it's a bit buggy, I think they migrated all the config options to other formats and when it is migrated automatically it breaks some stuff.

Yes, it is working. I just used it.

@msmolka
Copy link

msmolka commented Apr 5, 2022

for me it is also buggy:
obraz

@bplatypus
Copy link

doesn't seem to work anymore. It's doing a migration:
Oh My Posh config migrated to version 2 Backup config available at C:\Users\username\AppData\Local\Programs\oh-my-posh\themes\ohmyposhv3-v2.json.bak

@eclipsology
Copy link

eclipsology commented Jun 9, 2022

For anyone having the heart/check error, try this.

Change This:
"template": " \ue23a{{ if gt .Code 0 }}\uf00d{{ else }}\uf42e{{ end }} ",
To this in your .json file:
"template": " \ue23a ",

@hero3616
Copy link

EclipseDevelopment thank you for the tip. It worked for me.

@thienluhoan
Copy link

thienluhoan commented Jul 26, 2023

How to show github icon in front of git branch ?

@IP0
Copy link

IP0 commented Oct 14, 2023

Yo Scott, you sharing that V4 with us? ;)

@darenc
Copy link

darenc commented Oct 28, 2023

How to show github icon in front of git branch ?

Presuming you're using a "Nerd Font" style of font with all the symbols, you can just put the character in the template.

Mine looks like this:

image

"template": " \ue709 {{ .HEAD }} ... ",

U+E709 is an Octocat symbol in CaskaydiaCove NF.

image

@dotnetemmanuel
Copy link

I can't seem to get that rocket icon thingy work when on D: (my DevDrive). Anyone?

@JKc66
Copy link

JKc66 commented Jul 11, 2024

can you please update this to the latest version , thank you

@manish-goyal-Nagarro
Copy link

manish-goyal-Nagarro commented Aug 12, 2024

@shanselman , I love these little details. I am modifying this to show a prompt segment in one line and type commands on the next line. But when I do that, tab for completing the path from suggestion is not working. It auto-replaces the CD with the Path.

image

and after pressing tab -

image

can you please help me?

json file -

image

@SniperElite83
Copy link

Thank you @shanselman for your hard work. I followed this tutorial before, and it worked like a charm.
I got my new machine, so I wanted to apply it again, but something weird is happening. The oh-my-posh.json file for unknown reason is being replaced and the old version kept as a backup file and the heart and other icons are not working anymore, see my screenshot. I made the Jason file for Read-Only and VSCode is unable to change it anymore but that didn't fix the problem even it stopped the VSCode from changing the file content.
Any reason for that?

image

@SniperElite83
Copy link

Thank you @shanselman for your hard work. I followed this tutorial before, and it worked like a charm. I got my new machine, so I wanted to apply it again, but something weird is happening. The oh-my-posh.json file for unknown reason is being replaced and the old version kept as a backup file and the heart and other icons are not working anymore, see my screenshot. I made the Jason file for Read-Only and VSCode is unable to change it anymore but that didn't fix the problem even it stopped the VSCode from changing the file content. Any reason for that?

image

I think I figured out what's the problem, I just replaced the oh-my-posh Jason file with the Theme file from the oh-my-posh website.
https://ohmyposh.dev/docs/themes

image

@SniperElite83
Copy link

I think I figured out what's the problem, I just replaced the oh-my-posh Jason file with the Theme file from the oh-my-posh website.
https://ohmyposh.dev/docs/themes

image

@xvsvg
Copy link

xvsvg commented Mar 23, 2025

Thank you @shanselman for your hard work. I followed this tutorial before, and it worked like a charm. I got my new machine, so I wanted to apply it again, but something weird is happening. The oh-my-posh.json file for unknown reason is being replaced and the old version kept as a backup file and the heart and other icons are not working anymore, see my screenshot. I made the Jason file for Read-Only and VSCode is unable to change it anymore but that didn't fix the problem even it stopped the VSCode from changing the file content. Any reason for that?

image

my fix looks like this

{
          "properties": {
            "always_enabled": true,
            "color_background": true,
            "display_exit_code": false,
            "error_color": "#ff0000",
            "prefix": " \ue23a"
          },
          "style": "diamond",
          "template": " \ue23a ",
          "trailing_diamond": "\ue0b4",
          "type": "status",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "background": "#2e9599"
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment