Skip to content

Example of how to set up Windows terminal with Oh My Posh

License

Notifications You must be signed in to change notification settings

zaknafien99/WindowsTerminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Windows Terminal

I have been using windows terminal from it's earliest days from it's first public Beta to now. It has become a very powerful tool for system management and software development.

Obtainable from the Microsoft Store in windows 10 and 11 it has become my go to for PowerShell and software development. You can do some really cool things with it like make the prompt look awesome: image

You can get intellisense style command completion: image

It just makes the experience better that using the standard command prompt or even powershell. But how do you set up this new hotness?

You will need to install a few powershell modules:

  1. posh-git
  2. Terminal-Icons
  3. Powerline

I recommend using Visual Studio Code to edit the Microsoft.PowerShell_profile.ps1 file and enter these commands:

Add-WindowsPSModulePath

Import-Module -name posh-git

import-module -name Terminal-Icons

import-module -Name powerline

oh-my-posh init pwsh | Invoke-Expression

if ($host.Name -eq 'ConsoleHost')

{

Import-Module PSReadLine    

}

Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward

Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward

Set-PSReadLineKeyHandler -Key Tab -Function Complete

Set-PSReadLineOption -PredictionSource History

Set-PSReadLineOption -PredictionViewStyle ListView

Set-PSReadLineOption -HistoryNoDuplicates

Set-PSReadLineOption -HistorySaveStyle SaveIncrementally

Set-PSReadLineOption -ShowToolTips

Set-PSReadLineOption -HistorySearchCursorMovesToEnd

Set-PSReadLineOption -EditMode Emacs

These commands enable Intellisense style autocompletion.

You also need to set a PowerLine font. image

You can also set this in the JSON and in the early days this was the only way to do it, but you have more control through the GUI and it won't break the terminal if you miss a comma. YOu can get some really cool fonts from NerdFonts. For more information read the great Scott Hanselman's blog: https://www.hanselman.com/blog/my-ultimate-powershell-prompt-with-oh-my-posh-and-the-windows-terminal

There's lots of great information out there, how have you set up your terminal?

About

Example of how to set up Windows terminal with Oh My Posh

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published