{"id":15192255,"url":"https://github.com/jandedobbeleer/oh-my-posh2","last_synced_at":"2025-10-02T07:30:30.876Z","repository":{"id":53825813,"uuid":"54226191","full_name":"JanDeDobbeleer/oh-my-posh2","owner":"JanDeDobbeleer","description":"A prompt theming engine for Powershell","archived":true,"fork":false,"pushed_at":"2021-02-16T07:48:59.000Z","size":541,"stargazers_count":5165,"open_issues_count":0,"forks_count":282,"subscribers_count":86,"default_branch":"master","last_synced_at":"2024-05-19T10:09:47.083Z","etag":null,"topics":["agnoster","agnoster-theme","conemu","coverage-status","gitter-badge","hacktoberfest","paradox","powerline","powershell","powershell-gallery","theme","theme-engine"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JanDeDobbeleer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"jandedobbeleer","liberapay":"jandedobbeleer","custom":"https://ko-fi.com/jandedobbeleer"}},"created_at":"2016-03-18T19:22:41.000Z","updated_at":"2024-05-19T10:09:47.084Z","dependencies_parsed_at":"2022-08-21T15:00:24.859Z","dependency_job_id":null,"html_url":"https://github.com/JanDeDobbeleer/oh-my-posh2","commit_stats":null,"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanDeDobbeleer%2Foh-my-posh2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanDeDobbeleer%2Foh-my-posh2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanDeDobbeleer%2Foh-my-posh2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanDeDobbeleer%2Foh-my-posh2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JanDeDobbeleer","download_url":"https://codeload.github.com/JanDeDobbeleer/oh-my-posh2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234951983,"owners_count":18912496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agnoster","agnoster-theme","conemu","coverage-status","gitter-badge","hacktoberfest","paradox","powerline","powershell","powershell-gallery","theme","theme-engine"],"created_at":"2024-09-27T21:20:32.027Z","updated_at":"2025-10-02T07:30:25.583Z","avatar_url":"https://github.com/JanDeDobbeleer.png","language":"PowerShell","funding_links":["https://patreon.com/jandedobbeleer","https://liberapay.com/jandedobbeleer","https://ko-fi.com/jandedobbeleer","https://www.patreon.com/jandedobbeleer"],"categories":[],"sub_categories":[],"readme":"# oh-my-posh\r\n\r\n[![Build status][build-status-badge]][build-status]\r\n[![Travis build status][travis-build-status-badge]][travis-build-status]\r\n[![Coverage Status][coverage-status-badge]][coverage-status]\r\n[![Gitter][gitter-badge]][gitter]\r\n[![PS Gallery][psgallery-badge]][powershell-gallery]\r\n\r\n## ❤ Support ❤\r\n\r\n[![Patreon][patreon-badge]][patreon]\r\n[![Liberapay][liberapay-badge]][liberapay]\r\n[![Ko-Fi][kofi-badge]][kofi]\r\n\r\n## Introducing V3 and what it means for V2\r\n\r\nIt's been an amazing ride for Oh myPosh, but the time has come to step it up a notch.\r\nDevelopers nowadays no longer stick to one shell/language, they are all tools we use to solve a certain problem.\r\nThe same needs to apply to Oh my Posh. It's time to adjust to that philosophy.\r\n\r\nThat's why this version of Oh my Posh is entering maintenance mode while I'm working hard on getting [V3][v3] out of the door.\r\nGiven that [V3][v3] is entirely different under the hood, it's hosted [separately][v3] for now.\r\nFrom a user perspective, it should give the same experience out-of-the-box, with the added advantage\r\nthat custom themes are a first class, no code citizen.\r\n\r\n```powershell\r\nInstall-Module oh-my-posh -Scope CurrentUser -AllowPrerelease\r\n```\r\n\r\n[Documentation][docs-v3] is also available which should give a better experience than this **README** has over the past few years :-)\r\n\r\nIf you're a developer looking to add functionality, please have a look at [V3][v3] to see if it already exists there.\r\nIf not, feel free to create an issue or PR on [V3][v3], _**I will only be accepting bug fixes on V2 from now on**_.\r\n\r\n## Table of Contents\r\n\r\n- [About](#about)\r\n- [Prerequisites](#prerequisites)\r\n- [Installation](#installation)\r\n- [Configuration](#configuration)\r\n- [Helper functions](#helper-functions)\r\n- [Themes](#themes)\r\n\r\n## About\r\n\r\nA theme engine for Powershell inspired by the work done by Chris Benti on [PS-Config][chrisbenti-psconfig] and [Oh-My-ZSH][oh-my-zsh] on OSX and Linux (hence the name).\r\n\r\nMore information about why I made this can be found on my [blog].\r\n\r\n![Theme][img-indications]\r\n\r\nFeatures:\r\n\r\n- Easy installation\r\n- Awesome prompt themes for PowerShell in ConEmu\r\n- Git status indications (powered by posh-git)\r\n- Failed command indication\r\n- Admin indication\r\n- Current session indications (admin, failed command, user)\r\n- Configurable\r\n- Easily create your own theme\r\n- Separate settings for oh-my-posh and posh-git\r\n- Does not mess with the default Powershell console\r\n\r\n## Prerequisites\r\n\r\nYou should use a modern console host like [ConEmu][conemu], [Alacritty][alacritty], [Terminus][terminus], [Hyper][hyper], [FluentTerminal][fluentterminal], or the official [Windows Terminal][windowsterminal] to have a great terminal experience on Windows.\r\n\r\nThere are multiple ways to acquire Windows Terminal - from the Microsoft [Store](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701), the GitHub [repo](https://github.com/microsoft/terminal/releases), or the below commandline methods:\r\n\r\nVia [WinGet][winget] (official package manager for Windows):\r\n\r\n```powershell\r\nwinget install --id=Microsoft.WindowsTerminal -e\r\n```\r\n\r\nVia [Chocolatey][chocolatey]:\r\n\r\n```powershell\r\nchoco install microsoft-windows-terminal\r\n```\r\n\r\nVia [Scoop][scoop]:\r\n\r\n```powershell\r\nscoop install windows-terminal\r\n```\r\n\r\nThe fonts I use are Powerline fonts, there is a great [repository][nerdfonts] containing them.\r\nI use `Meslo LG M Regular for Powerline Nerd Font` in my ConEmu setup together with custom colors. You can find my theme [here][theme-gist].\r\n\r\nIn case you notice weird glyphs after installing a font of choice, make sure the glyphs are available (maybe they have a different location in the font, if so, adjust the correct `$ThemeSettings` icon). If it turns out the character you want is not supported, select a different font.\r\n\r\n## Installation\r\n\r\nYou need to use the [PowerShell Gallery][powershell-gallery] to install oh-my-posh.\r\n\r\nInstall posh-git and oh-my-posh:\r\n\r\n```powershell\r\nInstall-Module posh-git -Scope CurrentUser\r\nInstall-Module oh-my-posh -Scope CurrentUser\r\n```\r\n\r\nEnable the prompt:\r\n\r\n```powershell\r\n# Start the default settings\r\nSet-Prompt\r\n# Alternatively set the desired theme:\r\nSet-Theme Agnoster\r\n```\r\n\r\nIn case you're running this on PS Core, make sure to also install version 2.0.0-beta1 of `PSReadLine`\r\n\r\n```powershell\r\nInstall-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck\r\n```\r\n\r\nTo enable the engine edit your PowerShell profile:\r\n\r\n```powershell\r\nif (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }\r\nnotepad $PROFILE\r\n```\r\n\r\nAppend the following lines to your PowerShell profile:\r\n\r\n```powershell\r\nImport-Module posh-git\r\nImport-Module oh-my-posh\r\nSet-Theme Paradox\r\n```\r\n\r\nThe last command sets the theme for the console. Check the available themes list below.\r\n\r\n## Configuration\r\n\r\nList the current configuration:\r\n\r\n```powershell\r\n$ThemeSettings\r\n```\r\n\r\n![Theme][img-themesettings]\r\n\r\nYou can tweak the settings by manipulating `$ThemeSettings`.\r\nThis example allows you to tweak the branch symbol using a unicode character:\r\n\r\n```powershell\r\n$ThemeSettings.GitSymbols.BranchSymbol = [char]::ConvertFromUtf32(0xE0A0)\r\n```\r\n\r\nAlso do not forget the Posh-Git settings itself (enable the stash indication for example):\r\n\r\n```powershell\r\n$GitPromptSettings\r\n```\r\n\r\nHide your `username@domain` when not in a virtual machine for the Agnoster, Fish, Honukai, Paradox and Sorin themes:\r\n\r\n```powershell\r\n$DefaultUser = 'yourUsernameHere'\r\n```\r\n\r\n## Helper functions\r\n\r\n`Set-Theme`: set a theme from the Themes directory. If no match is found, it will not be changed. Autocomplete is available to list and complete available themes.\r\n\r\n```powershell\r\nSet-Theme paradox\r\n```\r\n\r\n`Show-ThemeColors`: display the colors used by the theme\r\n\r\n![Theme][img-themecolors]\r\n\r\n`Show-Colors`: display colors configured in ConEmu\r\n\r\n![Theme][img-showcolors]\r\n\r\n## Themes\r\n\r\n### Agnoster\r\n\r\n![Agnoster Theme][img-theme-agnoster]\r\n\r\n### Paradox\r\n\r\n![Paradox Theme][img-theme-paradox]\r\n\r\n### Sorin\r\n\r\n![Sorin Theme][img-theme-sorin]\r\n\r\n### Darkblood\r\n\r\n![Darkblood Theme][img-theme-darkblood]\r\n\r\n### Avit\r\n\r\n![Avit Theme][img-theme-avit]\r\n\r\n### Honukai\r\n\r\n![Honukai Theme][img-theme-honukai]\r\n\r\n### Fish\r\n\r\n![Fish Theme][img-theme-fish]\r\n\r\n### Robbyrussell\r\n\r\n![Robbyrussell Theme][img-theme-robbyrussell]\r\n\r\n### Pararussel\r\n\r\n![Pararussel Theme][img-theme-pararussell]\r\n\r\n### Material\r\n\r\n![Material Theme][img-theme-material]\r\n![Material Theme][img-theme-material2]\r\n\r\n### Star\r\n\r\n![Star Theme][img-theme-star]\r\n\r\n### Zash\r\n\r\n![Star Theme][img-theme-zash]\r\n\r\n### Lambda\r\n\r\n![Lambda Theme](./img/lambda.png)\r\n\r\n### Emodipt\r\n\r\n![Emodipt Theme][img-theme-emodipt]\r\n\r\n### Operator\r\n\r\n![Operator Theme][img-theme-operator]\r\n\r\n## Creating your own theme\r\n\r\nIf you want to create a theme it can be done rather easily by adding a `mytheme.psm1` file in the folder indicated in `$ThemeSettings.MyThemesLocation` (the folder defaults to `~\\Documents\\WindowsPowerShell\\PoshThemes`, feel free to change it).\r\n\r\nThe only required function is `Write-Theme`. You can use the following template to get started:\r\n\r\n```powershell\r\n#requires -Version 2 -Modules posh-git\r\n\r\nfunction Write-Theme\r\n{\r\n    param(\r\n        [bool]\r\n        $lastCommandFailed,\r\n        [string]\r\n        $with\r\n    )\r\n\r\n    # enter your prompt building logic here\r\n}\r\n\r\n$sl = $global:ThemeSettings #local settings\r\n```\r\n\r\nFeel free to use the public helper functions `Get-VCSStatus`, `Get-VcsInfo`, `Get-FormattedRootLocation`, `Get-ShortPath`, `Set-CursorForRightBlockWrite`, `Set-CursorUp`, `Set-Newline` or add your own logic completely.\r\n\r\nTo test the output in ConEmu, just switch to your theme:\r\n\r\n```powershell\r\nSet-Theme mytheme\r\n```\r\n\r\nIf you want to include your theme in oh-my-posh, send me a PR and I'll try to give feedback ASAP.\r\n\r\nHappy theming!\r\n\r\n### Adding stack count to a custom theme\r\n\r\nAs it seems getting access to the stack information when using pushd/popd is sort of mission impossible from within a theme, you can use a workaround proposed by [Jonathan Leech-Pepin][jleechpe]. In your `$PROFILE`, add a variable that will act as a correctly scoped pointer to fetch the stack context:\r\n\r\n```powershell\r\n$getStackContext = {Get-Location -Stack}\r\n```\r\n\r\nNext, in your custom theme, access the information you want to display:\r\n\r\n```powershell\r\n$stackCount = (\u0026$getStackContext).count\r\n```\r\n\r\n### iTerm2 is creating notifications every time\r\n\r\nThis is caused by the `ConsoleTitle` functionality.\r\nAs explained by [Andrew Stanton-Nurse][consoletitle] it's linked to how terminals work with OSC codes.\r\nThe fix is to disable the `ConsoleTitle` functionality when in iTerm2 by adding the following snippet to your `$PROFILE`.\r\n\r\n```powershell\r\nif($env:LC_TERMINAL -eq \"iTerm2\") {\r\n    $ThemeSettings.Options.ConsoleTitle = $false\r\n}\r\n```\r\n\r\n### Based on work by\r\n\r\n- [Chris Benti][chrisbenti-psconfig]\r\n- [Keith Dahlby][keithdahlby-poshgit]\r\n\r\n[build-status-badge]: https://img.shields.io/appveyor/ci/janjoris/oh-my-posh2/master.svg?maxAge=2592000\r\n[build-status]: https://ci.appveyor.com/project/JanJoris/oh-my-posh2\r\n[travis-build-status-badge]: https://travis-ci.org/JanDeDobbeleer/oh-my-posh2.svg?branch=master\r\n[travis-build-status]: https://travis-ci.org/JanDeDobbeleer/oh-my-posh2\r\n[coverage-status-badge]: https://coveralls.io/repos/github/JanDeDobbeleer/oh-my-posh2/badge.svg\r\n[coverage-status]: https://coveralls.io/github/JanDeDobbeleer/oh-my-posh2\r\n[gitter-badge]: https://badges.gitter.im/oh-my-posh/Lobby.svg\r\n[gitter]: https://gitter.im/oh-my-posh/general?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\r\n[psgallery-badge]: https://img.shields.io/powershellgallery/dt/oh-my-posh.svg\r\n[powershell-gallery]: https://www.powershellgallery.com/packages/oh-my-posh/\r\n[patreon-badge]: https://img.shields.io/badge/Support-Become%20a%20Patreon!-red.svg\r\n[patreon]: https://www.patreon.com/jandedobbeleer\r\n[liberapay-badge]: https://img.shields.io/badge/Liberapay-Donate-%23f6c915.svg\r\n[liberapay]: https://liberapay.com/jandedobbeleer\r\n[kofi-badge]: https://img.shields.io/badge/Ko--fi-Buy%20me%20a%20coffee!-%2346b798.svg\r\n[kofi]: https://ko-fi.com/jandedobbeleer\r\n[scoop]: https://scoop.sh/\r\n[scoop-extras]: https://github.com/lukesampson/scoop/wiki/Buckets\r\n[windowsterminal]: https://github.com/microsoft/terminal\r\n[conemu]: https://conemu.github.io/\r\n[alacritty]: https://github.com/alacritty/alacritty\r\n[terminus]: https://eugeny.github.io/terminus/\r\n[fluentterminal]: https://github.com/felixse/FluentTerminal\r\n[hyper]: https://hyper.is/\r\n[winget]: https://github.com/microsoft/winget-cli\r\n[chrisbenti-psconfig]: https://github.com/chrisbenti/PS-Config\r\n[keithdahlby-poshgit]: https://github.com/dahlbyk/posh-git\r\n[jleechpe]: https://github.com/jleechpe\r\n[oh-my-zsh]: https://github.com/robbyrussell/oh-my-zsh\r\n[blog]: https://blog.itdepends.be/shell-shock/\r\n[chocolatey]: https://chocolatey.org/\r\n[nerdfonts]: https://github.com/ryanoasis/nerd-fonts\r\n[theme-gist]: https://gist.github.com/JanDeDobbeleer/71c9f1361a562f337b855b75d7bbfd28\r\n[img-indications]: img/indications.png\r\n[img-themesettings]: img/themesettings.png\r\n[img-themecolors]: img/themecolors.png\r\n[img-showcolors]: img/showcolors.png\r\n[img-theme-agnoster]: img/agnoster.png\r\n[img-theme-paradox]: img/paradox.png\r\n[img-theme-sorin]: img/sorin.png\r\n[img-theme-darkblood]: img/darkblood.png\r\n[img-theme-avit]: img/avit.png\r\n[img-theme-honukai]: img/honukai.png\r\n[img-theme-fish]: img/fish.png\r\n[img-theme-robbyrussell]: img/robbyrussel.png\r\n[img-theme-pararussell]: img/pararussel.png\r\n[img-theme-material]: img/material.png\r\n[img-theme-material2]: img/material2.png\r\n[img-theme-star]: img/star.png\r\n[img-theme-zash]: img/zash.png\r\n[img-theme-emodipt]: img/emodipt.png\r\n[img-theme-operator]: img/operator.png\r\n[consoletitle]: https://github.com/JanDeDobbeleer/oh-my-posh2/issues/261#issuecomment-649701607\r\n[v3]: https://github.com/JanDeDobbeleer/oh-my-posh3\r\n[docs-v3]: https://ohmyposh.dev\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandedobbeleer%2Foh-my-posh2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjandedobbeleer%2Foh-my-posh2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandedobbeleer%2Foh-my-posh2/lists"}