New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for CMD #21
Comments
In theory you should be able to call the executable just like you would on Powershell. Let me check and add that info to the README |
Never mind the previous activity, that was me fighting the Github Android app 😅 |
That'd be really slick! |
You'd think this should be possible, right? Well, turns out my friend |
Yes I tried fighting with it too. Calling the |
It's more limited to my friend |
Doesn't seem to be possible yet with everything I've tried, I'll keep this open in case I (or someone else) has a brilliant idea that might work. |
Sure! |
Had a look once again and it's just not possible as far as I can tell. |
@JanDeDobbeleer Yes, it seemed really difficult. Any idea how Cmder achieved a custom prompt though? Was it terminal-specific? |
You can change it once, but not change it on the fly and as elaborate as oh-my-posh does. I will have a look though. If what conemu does works on every prompt invocation, it might work. |
I reached this point but as I feared, you can't update the path and other information once you set the string meaning you would need to return the standard variables CMD understands for them to be dynamic. Conemu can do a bit more magic as they own the shell, meaning they have some magic variables they can inject at runtime, but that's not something I can offer. Therefore we can't support CMD 😢 |
I understand. Thank you for your efforts though! OMP3 looks really in all other shells btw! |
Hey @JanDeDobbeleer, sorry for bumping this old thread again, but I think I finally figured it out! It might be out of scope of this project, but Conemu actually uses Clink under the hood, which offers it the ability to have a custom prompt with the help of Lua scripting - Customizing the Prompt - as mentioned here. With a simple function like this: local custom_prompt = clink.promptfilter(50)
function custom_prompt:filter(prompt)
return io.popen("oh-my-posh --config C:\\Users\\RashilGandhi\\.oh-my-posh\\honukai.omp.json"):read("*a")
end I was able to have a dynamic and fully working prompt I say this is out of scope because, well anyone looking for using OMP with CMD will have to install Clink then. Anyways, just wanted to share! |
Thanks @rashil2000 I'd like to extend your answer a little bit more, in case anyone comes across this issue who is also using ConEmu, most of the tutorials out there only specify how it would work for PowerShell, and I am not a fan. I prefer Cmder. In order to get oh-my-posh working: local custom_prompt = clink.promptfilter(50)
function custom_prompt:filter(prompt)
return io.popen("oh-my-posh"):read("*a")
end @JanDeDobbeleer |
@AbdelrahmanHafez it's documentation so I don't mind having this info in the docs tbh. |
Clink's (the extension framework that Cmder uses) own documentation also has a section for oh-my-posh, maybe that can be referred - https://chrisant996.github.io/clink/clink.html#oh-my-posh |
👍 This command worked for me to make changes in the command prompt! load(io.popen('oh-my-posh.exe --config="C:/Users/YourName/AppData/Local/Programs/oh-my-posh/themes/themeName.omp.json" --init --shell cmd'):read("*a"))() |
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. |
Since this is a (almost) platform-agnostic shell themer, is there a way to support Command Prompt in Windows?
For inspiration, you can check out how Cmder does it.
For the most part, it just requires changing the
prompt
environment variable. Like this, for example:The text was updated successfully, but these errors were encountered: