posh-git is a PowerShell module that integrates Git and PowerShell by providing Git status summary information that can be displayed in the PowerShell prompt.
posh-git also provides tab completion support for common git commands, branch names, paths and more.
For example, with posh-git, PowerShell can tab complete git commands like checkout
by typing git ch
and pressing
the tab key. That will tab complete to git checkout
and if you keep pressing tab, it will
cycle through other command matches such as cherry
and cherry-pick
. You can also tab complete remote names and
branch names e.g.: git pull or<tab> ma<tab>
tab completes to git pull origin main
.
Oh My Posh is a custom prompt engine for any shell that has the ability to adjust the prompt string with a function or variable.
A PowerShell module to show file and folder icons in the terminal.
Terminal-Icons is a PowerShell module that adds file and folder icons when displaying items in the terminal. This relies on the custom fonts provided by Nerd Fonts.
You must be using one of the fonts provided by Nerd Fonts for this module to work as these fonts include tons of custom glyphs/icons that are referenced by their unicode number.
winget install oh-my-posh
Install-Module posh-git -Scope CurrentUser
Install-Module -Name Terminal-Icons -Repository PSGallery -Scope CurrentUser
Edit the $PROFILE
file (~\Documents\Powershell\Microsoft.PowerShell_profile.ps1), add the following lines to the top:
Import-Module posh-git
Import-Module -Name Terminal-Icons
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\blue-owl.omp.json" | Invoke-Expression
More oh-my-posh
prompts can be found at Themes | Oh My Posh.
Change the Windows Terminal profile settings for Powershell Core to:
{
"antialiasingMode": "cleartype",
"colorScheme": "Campbell",
"font":
{
"face": "CaskaydiaCove NF"
},
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore"
}
Notes:
- The guid could be different.
- The font face is important for the correct icons.
Be sure to change the Font setting for the VS Code terminal or the icons will not show properly.
- It's time for you to install Windows Terminal
- Taking your PowerShell prompt to the next level with Windows Terminal and Oh my Posh 3
- Patching the new Cascadia Code to include Powerline Glyphs and other Nerd Fonts for the Windows Terminal
- Take your Windows Terminal and PowerShell to the next level with Terminal Icons