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
Top comments (6)
You have a config error though. using
oh-my-posh debug
you will be able to find exactly what's going on.Thanks for letting me know i will have a look in it
If you face any problem with it you can let me know
Hi! I've been working with pwsh and oh-my-posh for a while, but I really can't stand the loading time of pwsh (my CPU is already a 7950x, so I don't think the bottleneck is there), so I want to switch to clink for my work. However, I have some preloaded commands in my pwsh profile that provide git branch count data for my oh-my-posh theme (I don't know why oh-my-posh provides workertree count data but not branch count data). The code is as follows:
But I don't know how to convert this to clink's lua code so that this method is automatically called each time the theme is rendered, in order to refresh the environment variable BranchCount.
I apologize for late response to your question
i did some reach about your problem and i got this g.co/gemini/share/a82c30feca54
i took some help from AI Tools
i want you to know that i am not that expert with oh-my-posh . still in learning process
if we give enough time to a problem we will find a solution to it
thank you
if you still face problem ask me i love help you