published on 29.10.2020
edited on 03.03.2022

In this post, I am going to share quick steps that will help you customize your Windows Terminal. Because everyone needs a good looking terminal. I’ll use Powershell not bash (Linux subsystem). You may use other shells with Windows Terminal if you like to.

Windows Terminal
Windows Terminal
  1. Get Windows Terminal from store or github

  2. Get the latest Powershell. Don’t think you are using the latest Powershell just because your Windows 10 is up-to-date.

Get-Host | Select-Object Version will return PS Version, or you can use $PSVersionTable.

Powershell 7 (the latest version for the date I’m typing) is a standalone package, it’s not the same as the one that’s built into Windows. So, you have to install it separately. You can find the releases from powerhell github repo. Read more from ms docs if you need to.

  1. Next, open your new Powershell in Windows Terminal. Go to Windows Terminal Settings, you’ll see a list of shells. Here is an example:
"list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "commandline": "powershell.exe",
                "hidden": true
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "cmd",
                "commandline": "cmd.exe",
                "hidden": true
            },
            {
                // This is the new powershell!
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "Terminal",
                "commandline": "pwsh.exe -NoLogo"
            }
        ]

Do not copy-paste this one though, it won’t work. Because the guids will be different for you.

If “pwsh” is not there, check Powershell’s installation location C:\Program Files\PowerShell\7\ and make sure it’s included in the PATH. You need to restart your computer when the PATH is changed. So that changes take effect.

You may see, "source": "Microsoft.Powershell.Core" or something like that instead of "commandline": ... just add a new line: "commandline": "pwsh.exe -NoLogo"

PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

NoLogo helps you get rid of the ridiculous message above at the start.

  1. Once, you have the new powershell in the terminal settings, select it as the default profile.

  2. Install oh-my-posh, to get a prompt like oh-my-zsh.

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

And PSReadLine:

Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

Open Powershell Profile:

code $PROFILE
notepad $PROFILE

If you get an error saying no profile exists. Create it.

if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }

Add these lines to your profile. You don’t have to use the “Paradox” theme, see what’s available in the repo.

Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme paradox

I assume you already have git installed.

  1. Don’t panic if the some chars isn’t rendered correctly. That’s because you don’t have the proper fonts. We need a font with PowerLine features. Install any font PL - Powerline font you like. You can check out Nerd Fonts which is an amazing project I recently discovered.

  2. That’s all, you can play with Windows Terminal Settings, set themes via schemes. Here is my settings.json.

Bonus 1: If you are looking for more, you can assign shortcuts (like Ctrl + Alt + T) for the Terminal using AHK.

Bonus 2: You can also get interactive suggestions as you type from the history, check out this cool blog from Hanselman

All Useful Links:

Published on 29.10.2020 by Mert Bakır. Last update on 03.03.2022 with commit 4cdd031.
random
#customization #windows
published on 17.04.2022
edited on 02.05.2022

Önceki bölümde, markdown formatını LaTeX formatına dönüştürmek için kullanılan Pandoc yazılımından bahsetmiştik. Şimdi konuyu bir adım daha ileri taşıyıp ve bookdown’a geçiyoruz. Bookdown; Rmarkdown kullanarak teknik dökümanlar, kitaplar yazabilmemizi sağlayan, Yihui Xie tarafından yazılmış …

published on 10.04.2022

I’ve been using WSL-2 on Windows for over a year. It’s very useful because some Python packages are just a headache to install on Windows. Also, docker. It’s just better on Linux. Yet, WSL-2 can also be problematic. I remember trying a dual-boot setup when things just went way too …

published on 03.03.2022

In this post, I’ll share how to install geopandas and some other gis related packages on Windows. If you are on Mac or Linux you can probably just pip install those without any issue. I usually had to do a google search every time I wanted to install these packages on Windows environment. Of …

published on 19.02.2022

Önceki yazıda LaTeX kullanmanın avantajlarından ve zorluklarından bahsetmiştim, MS Word gibi WYSIWYG programlar ile karşılaştırıp tavsiyelerimi yazmıştım. Bu yazıda Pandoc yazılımı üzerine konuşacağız. Pandoc’un da yardımıyla LaTeX’in avantajlarını alıp zorluklarını biraz geri de …

published on 12.02.2022

LaTeX bir çeşit döküman hazırlama sistemidir, ancak çoğumuzun alıştığı arayüzlerin aksine bu döküman içerisinde kod yazar gibi bazı komutlar kullanırız. Daha sonra derleyici (compiler) bu dökümanı bizim tanımladığınız kurallara göre PDF’e dönüştürür. […] 1978 yılında, Donald Knuth TeX …

published on 02.01.2022

This post is for fellow students who is studying Operations Research with CPLEX. If you don’t know already, IBM offers free academic license for IBM ILOG CPLEX Optimization Studio. […] First, you have to register IBM Academic Initiative with your academic instituion issued email. (e.g. …