Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save codeitbhanu/954a7d986c9ec10c68fc8602d030e5ef to your computer and use it in GitHub Desktop.

Select an option

Save codeitbhanu/954a7d986c9ec10c68fc8602d030e5ef to your computer and use it in GitHub Desktop.
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Install Posh-Git and Oh-My-Posh

Installation instruction here...

Set-Theme agnoster

Install Powerline Fonts

Clone the powerline repository from GitHub.

git clone https://github.com/powerline/fonts.git

afterward, do the following:

cd fonts
.\install.ps1

Wait for all the fonts to be installed.

Select the Font You Want to Use from Cmder / ConEmu

From inside Cmder / ConEmu settings dialog, ensure you choose the powerline font you wish to used. i.e. Menslo ... for Powerline, etc. Also make sure you set the same font for the Alternative font to use, otherwise some characters will not show.

How to test if Powerline is correctly installed in Cmder / ConEmu:

  1. Add the following function to your powerline $PROFILE. To edit your $PROFILE, just run ise $PROFILE from within PowerShell:
function U
{
    param
    (
        [int] $Code
    )
 
    if ((0 -le $Code) -and ($Code -le 0xFFFF))
    {
        return [char] $Code
    }
 
    if ((0x10000 -le $Code) -and ($Code -le 0x10FFFF))
    {
        return [char]::ConvertFromUtf32($Code)
    }
 
    throw "Invalid character code $Code"
}

stole from here.

  1. Run the following script inside PowerShell:
Write-Host "$(U 0xE0B0) $(U 0x00B1) $(U 0xE0A0) $(U 0x27A6) $(U 0x2718) $(U 0x26A1) $(U 0x2699)"

You should see something like the second line in the figure below: Git Characters

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