Imdad Rind
Posted on March 14, 2024
If you are a fan of CMD and want the beauty of oh-my-posh but you do not want to switch to Windows PowerShell so you on the right place
The problem is that CMD directly does not support oh-my-posh on it so that's why we need to do via Clink
Let's Start 😺:
Step : 1
First of all we need to install oh-my-posh
winget install JanDeDobbeleer.OhMyPosh -s winget
this commdand will install these things
oh-my-posh.exe - Windows executable
themes - The latest Oh My Posh
after installing oh-my-posh you should restart your Terminal for the path to be set
if the path does not automatically set you can do manual by copying the bin path of oh-my-posh and adding it as new path in Edit the system environment variables
Step 2 :
Now Download & Install CLink from
Clink
after installing clink open new Terminal you see some Changes
As you know that cmd directly does not support oh-my-posh on it
so Clink 👍
Step 3 :
Now we need find the path to Clink scripts directory which we can do by running this command
clink info
after running this you will get path to a lot of Clink associated but you need to select the path script
in the case of this image C:\User\WS\AppDate\Local\Clink is the path to scripts directory yours will be something similar
Step 4 :
Opening or going to Clink scripts directory
there you need to create a file named oh-my-posh.lua
Step 5 :
Open that file and and write or copy & past the following
load(io.popen('oh-my-posh.exe --config="C:/Users/me/jandedobbeleer.omp.json" --init --shell cmd'):read("*a"))()
here you should replace this C:/Users/me/jandedobbeleer.omp.json config with your own configuration.
Step 6 :
Restart you terminal or cmd then your good to go
you might not have the best experiences with but it is something or you might do it better than me
Thank You ❤️
Thank you for giving me the honor to let you know how to do the thing i am very grateful to you
Reference 😊
And am thankful to all the people who worked on the product, documents and the problems & issues with it
Oh-My-posh Windows install
Clink downalond link
Change your prompt from PowerShell to CMD
config oh-my-posh with Clink
using git-posh or/and oh-my-posh with Command Prompt(cmd, not Powershell) inside windows terminal
oh-my-posh Support for CMD
Posted on March 14, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.