Customize Windows Terminal in Powershell

Terminal is the tools for developer and operator and it streamline many routine process in batch. And we are face it almost everyday.

There are several tools which can help to customize it to make it coo.

Perquisites

  1. Windows Terminal should be install.
    It can install in Windows Store.

Steps

  1. Install Nerd Fonts.
    Nerd Fonts is a set of fonts and icon-sets enables developer make IDE font more readable and more icons available to use by front-end developers.
    Remind that, it needs to install fonts to use it instead of reference it in path.

  2. Install Power shell modules.
    Execute commands below in PowerShell to install module oh-my-posh and posh-git.
    oh-my-posh is a prompt engine to customize prompt string with functions and variable. posh-git is one of the plug-in.

    Install-Module -Name oh-my-posh
    Install-Module -Name posh-git
    Install-Module -Name terminal-icons
    Set-PoshPrompt jandedobbeleer
  3. Select Windows Terminal color tone.
    Go to Windows Terminal Theme, select color tone you like and click Get Theme, related color scheme will copy to clipboard.
  4. Open Windows Terminal settings.
    Open Windows Terminal, select icon and click settings.
  5. Alter color scheme in settings.json.
    In scheme tag, paste color scheme JSON which copy before.
  6. Apply Nerd fonts and color scheme settings.
    In default tag, add properties as below.

    "fontFace": "FiraCode NF",
    "colorScheme": "Afterglow"
  7. Open PowerShell load profile.
    Execute command below.

    notepad $profile
  8. Apply pre-execute command
    Input command as below.

    Import-Module oh-my-posh
    Import-Module posh-git
    Import-Module terminal-icons
    Set-PoshPrompt jandedobbeleer
  9. Test.
    Reopen Windows Terminal, expected color tone and prompt string updated.

Reference

  1. Nerd Fonts
    https://www.nerdfonts.com/
  2. Oh my posh
    https://ohmyposh.dev/
  3. posh-git, GitHub,
    https://github.com/dahlbyk/posh-git
  4. Windows Terminal Theme
    https://windowsterminalthemes.dev/
About C.H. Ling 262 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.