For developers or users of Windows Terminal, this tutorial helps you customize the Terminal for PowerShell or WSL. This customization enhances the command line experience in Windows 11. Using Oh My Posh, a popular prompt theme engine, you can beautify your shell with icons, glyphs, and colors. Credit goes to Scott Hanselman for demonstrating how to customize Windows Terminal in both Windows 10 and 11. Let’s dive in and learn how.
Mastering Windows Terminal Customization (2022)
Discover comprehensive instructions to personalize Windows Terminal, spanning from adding the acrylic effect to applying the Caskaydia font to your command line interface. Steps are provided for both PowerShell and Ubuntu (WSL). Feel free to navigate to any section by expanding the table below.
Applying Acrylic Effect to Windows Terminal in Windows 10/11
1. Begin by updating Windows Terminal to the latest version via Microsoft Store.
2. Open Windows Terminal and navigate to Settings.
3. In Settings, go to “Windows PowerShell” under “Profiles” in the left sidebar and switch to the “Appearance” tab.
4. Scroll down and enable the “Acrylic” toggle. Below, adjust the Acrylic opacity if desired. I’ve set it at 70%, but feel free to choose your preferred value. Click “Save” to confirm the changes. You’ve successfully customized the Windows Terminal.
5. Repeat for CMD, WSL, and other shells on your Windows computer to add the Acrylic effect.
Add Caskaydia Cove Font to Windows Terminal
1. After adding the Acrylic effect, install fonts compatible with Oh My Posh. I’ve chosen Caskaydia Cove Nerd Font, ideal for this third-party customization tool. Download the font here.
2. After downloading the font, unzip it using apps like 7Zip or WinZip, and install all fonts. You can select all the fonts -> right-click on them -> Show more options -> Install for all users.
3. Now, open Windows Terminal and move to the Settings. Here, switch to the “Windows PowerShell” section from the left pane and move to the “Appearance” tab just like above.
4. Here, choose the newly-downloaded font you want to use with the Oh My Posh prompt. I have selected “Caskaydia Cove Nerd Font“. Now, click on “Save”.
5. Repeat this process for all the shells you are using on Windows 10/ 11, including WSL/Ubuntu.
Customize PowerShell in Windows Terminal With Oh My Posh
1. After adding the Acrylic effect and applying a compatible font, install the Oh My Posh prompt by opening Windows Terminal with administrator privileges. To do this, search for Terminal using the Windows key and select “Open as administrator” from the right pane.
2. In the PowerShell window, run the command below to install the Oh My Posh prompt. Then, press “A” and Enter to proceed with the installation:
Install-Module oh-my-posh -Scope CurrentUser
3. Next, import the Oh My Posh profile using the command below. If prompted, press “A”, then Enter to continue with the installation:
Import-Module oh-my-posh
4. After that, install Terminal Icons. Brandon Olin developed Terminal Icons for PowerShell. Run the command below and allow for installation to complete. Ensure you are running Windows Terminal with admin privileges before executing this command.
Install-Module -Name Terminal-Icons -Repository PSGallery
5. Now to check if everything is running fine, execute the command below. This will bring up the new prompt.
oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression
6. So far, everything is running fine, but make Oh My Posh your default custom prompt. Run the command below. It will provide you a path, which you need to note down or copy-paste in Notepad.
7. Navigate to the path and locate the “Microsoft.PowerShell_profile.ps1” file. Open it with Notepad, insert the following lines, and save.
Set-PoshPrompt -Theme jandedobbeleer Import-Module -Name Terminal-Icons
Note: If the Microsoft.PowerShell_profile.ps1 file is not found in that location, proceed to the next step.
8. If the ps1 file is absent, create one easily. Right-click in the “WindowsPowerShell” folder, select New -> Text Document.
9. Rename it as Microsoft.PowerShell_profile.ps1. Ensure no .txt extension is present. The filename should conclude with .ps1.
10. Open the file with Notepad and append the following two lines. Save and close Notepad.
11. Return to the PowerShell window and execute the command below to reload the profile.
. $PROFILE
12. Lastly, close Windows Terminal and reopen it. You’ll notice that Oh My Posh is now the default prompt in PowerShell. With the Acrylic effect, new fonts, icons, glyphs, and the Oh My Posh prompt, PowerShell in Windows Terminal looks stunning.
Customize WSL/Ubuntu in Windows Terminal Using Oh My Posh
Once you’ve applied the Acrylic effect and installed the fonts, it’s time to customize WSL with Oh My Posh. Here’s how:
1. Open Windows Terminal with admin privileges.
2. Move to WSL (Ubuntu or any other installed distro).
3. Before installing Oh My Posh, ensure WSL is up to date by updating its packages and dependencies. You may need to enter WSL’s password to confirm the installation.
sudo apt update && sudo apt upgrade -y
4. Following that, execute the commands below individually to install Oh My Posh on WSL, allowing customization of Windows Terminal. You’ll need to confirm the installation by pressing “y”.
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh sudo chmod +x /usr/local/bin/oh-my-posh
5. Proceed by running the subsequent commands individually to download the themes.
mkdir ~/.poshthemes wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip unzip ~/.poshthemes/themes.zip -d ~/.poshthemes chmod u+rw ~/.poshthemes/*.json rm ~/.poshthemes/themes.zip
6. Afterward, execute the command below to check if the custom prompt is properly installed. This should display the new Oh My Posh prompt.
eval "$(oh-my-posh --init --shell bash --config ~/.poshthemes/jandedobbeleer.omp.json)"
7. To set Oh My Posh as your default prompt in WSL, run the following command. It will enable you to edit the Bash config file in Nano editor.
nano ~/.bashrc
8. In Nano editor, use keyboard arrow keys to locate “make less more friendly for non-text input files, see lesspipe(1)”. Below it, replace the command starting with “eval…”.
9. Type the command below directly into Nano editor as it doesn’t support copy-paste:
eval "$(oh-my-posh --init --shell bash --config ~/.poshthemes/jandedobbeleer.omp.json)"
10. Press “Ctrl + O” then Enter to save. Press “Ctrl + X” to exit Nano editor.
11. Run the command below to reload Bash profile. WSL will now load Oh My Posh prompt. Enjoy!
. ~/.bashrc
12. If there are glitches in rendering glyphs and text, ensure the correct Caskaydia Cove Nerd font is set for Ubuntu/other distros in the Windows Terminal Settings.
13. If the issue persists, reload the Bash profile each time you enter the WSL shell. Run the command below to fix everything. You can also restart your PC to verify the resolution.
. ~/.bashrc
Enhance Your Windows Terminal Appearance With Oh My Posh
Customize Windows Terminal to achieve a sophisticated look with icons, glyphs, acrylic effects, and more. While attempts were made to enhance the Command Prompt with Clink, they were unsuccessful. For further personalization with themes, background images, and colors, refer to our linked article. For inquiries, please leave a comment below.
Pritam Chopra is a seasoned IT professional and a passionate blogger hailing from the dynamic realm of technology. With an insatiable curiosity for all things tech-related, Pritam has dedicated himself to exploring and unraveling the intricacies of the digital world.