Customize your terminal using oh-my-posh theme

Hey developers,

Today I will show you how you can customize your windows terminal with your test like this. Or you can add your own theme. Trust me, and it’s super easy anyone can do. You need to know simple codding knowledge, and you are …


This content originally appeared on DEV Community and was authored by Shahin Alam

Alt Text

Hey developers,

Today I will show you how you can customize your windows terminal with your test like this. Or you can add your own theme. Trust me, and it’s super easy anyone can do. You need to know simple codding knowledge, and you are good to go. If you face any problem, write it down in the comment section. I will try to solve your problem.

In this tutorial, I am trying to make it as simple as I can. I will explain every detail you need to know when you are making your terminal theme.

Without wasting your valuable time, let’s jump to the tutorial.

Follow those simple steps.

               Set up Powerline in PowerShell

Step 1: Install the windows terminal by using this link.
https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab

Step 2: Install a Powerline font
https://www.nerdfonts.com/font-downloads
Using this link, you will find the font named FiraMono Nerd Font. Download and install it on your system.

Step 3: Now, you need to install Install Git for Windows by using this link
https://git-scm.com/downloads

Step 4: Let’s set up Git
Open windows terminal and type (CTRL +, ) to open setting
You'll want to append one of the profiles options below (depending on what version of git you have installed) to the "list": portion of the settings.json file
image

Profile options

Uncomment correct paths for command line and icon if you are using:

*Git for Windows in %PROGRAMFILES%
*Git for Windows in %USERPROFILE%
*If you're using scoop

image
image

Or you can use my setting.json file just copy and paste
https://git.io/J3nNy.

Alt Text

If you like the ( Learn with Sumit) terminal, then paste this code without making any changes.

Step 5: install oh my posh on windows terminal

https://ohmyposh.dev/
Using your windows terminal, install Posh-Git and Oh-My-Posh:

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

If you are using PowerShell Core, install PSReadline:

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

             Customize your PowerShell prompt

Using your windows terminal, import module Posh-Git and Oh-My-Posh:

Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme hotstick.minimal

Now paste one more command

echo $profile

It will show you this ps1 file path.

"C:\Users\Shahi\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"

Then paste another command

notepad $profile

image

It will open a notepad in this empty space. Paste the code below and save it
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme hotstick.minimal

Step 6: setup windows terminal setting.json

Open windows terminal and type (CTRL +, ) to open setting
Change those setting
image

Step 7: customize windows terminal Theme JSON.

In this step, you need to copy-paste my customized theme.
Open terminal and run
Get-PoshThemes

Now you can see the list of all themes of oh-my-posh. We pick one theme named hotstick.minimal.omp.json

Paste the command to the terminal.
Set-PoshPrompt -Theme hotstick.minimal

Now let’s customize hotstick.minmal

https://git.io/J3cIq
Check the link and download the hotstick.minimal.omp.json
file:

Replace the hotstick.minimal json file on this file path

"C:\Program Files\WindowsPowerShell\Modules\oh-my-posh\3.134.0\themes\hotstick.minimal.omp.json"


This content originally appeared on DEV Community and was authored by Shahin Alam


Print Share Comment Cite Upload Translate Updates
APA

Shahin Alam | Sciencx (2021-05-01T10:45:55+00:00) Customize your terminal using oh-my-posh theme. Retrieved from https://www.scien.cx/2021/05/01/customize-your-terminal-using-oh-my-posh-theme/

MLA
" » Customize your terminal using oh-my-posh theme." Shahin Alam | Sciencx - Saturday May 1, 2021, https://www.scien.cx/2021/05/01/customize-your-terminal-using-oh-my-posh-theme/
HARVARD
Shahin Alam | Sciencx Saturday May 1, 2021 » Customize your terminal using oh-my-posh theme., viewed ,<https://www.scien.cx/2021/05/01/customize-your-terminal-using-oh-my-posh-theme/>
VANCOUVER
Shahin Alam | Sciencx - » Customize your terminal using oh-my-posh theme. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/01/customize-your-terminal-using-oh-my-posh-theme/
CHICAGO
" » Customize your terminal using oh-my-posh theme." Shahin Alam | Sciencx - Accessed . https://www.scien.cx/2021/05/01/customize-your-terminal-using-oh-my-posh-theme/
IEEE
" » Customize your terminal using oh-my-posh theme." Shahin Alam | Sciencx [Online]. Available: https://www.scien.cx/2021/05/01/customize-your-terminal-using-oh-my-posh-theme/. [Accessed: ]
rf:citation
» Customize your terminal using oh-my-posh theme | Shahin Alam | Sciencx | https://www.scien.cx/2021/05/01/customize-your-terminal-using-oh-my-posh-theme/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.