Update: official manual
- https://docs.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup
- https://ohmyposh.dev/docs/windows
- https://zimmergren.net/making-windows-terminal-look-awesome-with-oh-my-posh/
-
Open powershell in Admin mode then run
Set-ExecutionPolicy Unrestricted
-
Open powershell (without admin) Installing Posh-Git and Oh-My-Posh. Open Powershell then run
Install-Module posh-git -Scope CurrentUser Install-Module oh-my-posh -Scope CurrentUser
-
Download and Install font from https://github.com/microsoft/cascadia-code/releases (Release Zip file) (CascadiaCodePL.ttf and CascadiaMonoPL.ttf ) then in
Windows Terminal
go toSetting > Power Sehll > Appearance > Font face
change font toCascadia Code PL
then click save I likeCaskaydia Cove Nerd Font
https://www.nerdfonts.com/, which has the font nameCaskaydiaCove NF
when configuring it in the Windows Terminal font settings. -
In powershell run command
notepad $profile
to setup profile script. If you don't have any profile, notepad will ask to create new file. Then input below config to profile fileImport-Module posh-git Import-Module oh-my-posh Set-PoshPrompt -Theme paradox
This imports the modules posh-git and oh-my-posh and sets the theme to Paradox every time we start PowerShell. There are many themes to choose from https://ohmyposh.dev/ (or from source https://github.com/JanDeDobbeleer/oh-my-posh) or run
Get-PoshThemes
to display all theme on current Powershell -
In vscode change setting search
Font Family
then put'Cascadia Code PL'
in font config or"terminal.integrated.fontFamily": "Cascadia Code PL", "terminal.integrated.profiles.windows": { "PowerShell": { "source": "PowerShell", "icon": "terminal-powershell", "args": ["-NoLogo"] }, }, "terminal.integrated.defaultProfile.windows": "PowerShell",
- Export current theme to json file
oh-my-posh config export --output ~/.mytheme.omp.json
- Customize json as you see fit. You can get the idea or example from https://ohmyposh.dev/docs/themes. Click on each theme's name to view json config.
- Alter profile setting to load new theme. Replace
Set-PoshPrompt -Theme paradox
withoh-my-posh init pwsh --config ~/.jandedobbeleer.omp.json | Invoke-Expression
. Profile file will look like this.Import-Module posh-git Import-Module oh-my-posh oh-my-posh init pwsh --config ~/.jandedobbeleer.omp.json | Invoke-Expression
- Load new profile
. $PROFILE