DEV Community

Jono Cairns
Jono Cairns

Posted on

Enhancing Windows Terminal

terminal example

What you need:

  • Latest version of windows terminal
  • Latest version of powershell

Install-Module -Name PackageManagement -Repository PSGallery -Force
Install-Module -Name PowerShellGet -Repository PSGallery -Force
Install-Module PSReadLine -AllowPrerelease -Force
Install-Module posh-git -Scope CurrentUser
Install-Module -Name Terminal-Icons -Repository PSGallery

Now install oh-my-posh from here

Now install a nerd font so you can get all the nice symbols and stuff detailed here

Open your powershell profile by typing code $PROFILE in the terminal. Add the following config

Import-Module -Name Terminal-Icons

Import-Module posh-git

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/star.omp.json" | Invoke-Expression

Import-Module PSReadLine

Set-PSReadLineOption -PredictionSource History

Set-PSReadLineOption -PredictionViewStyle ListView

Set-PSReadLineOption -EditMode Windows
Enter fullscreen mode Exit fullscreen mode

Extra: if you want to be able to open terminal at set locations, hit CTRL + SHIFT , then add a line called startupActions like this

 "startupActions": "new-tab --tabColor #3B78FF -p \"Windows.Terminal.PowershellCore\" -d C:\\GIT\\Proj1 ; new-tab --tabColor #C19C00 -p \"Windows.Terminal.PowershellCore\" -d C:\\GIT\\Proj1",
Enter fullscreen mode Exit fullscreen mode

Another one - if you want the folder names to show up in the tabs do this:

code "$env:POSH_THEMES_PATH/star.omp.json" (replace the file name with the theme you are using)

add "console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}}", to the root anywhere

Top comments (0)