Closed mdnava closed 2 years ago
@mdnava please follow the official guide to initialize oh-my-posh in cmd as this way changes to the CLI will always break your prompt.
I tried this:
load(io.popen("oh-my-posh.exe prompt init cmd -config D:/mdnava/OneDrive/Command/EnvScripts/AutoRun/posh-prompt.json"):read("*a"))()
But got this:
Error: invalid argument "D:/mdnava/OneDrive/Command/EnvScripts/AutoRun/posh-prompt.json" for "oh-my-posh prompt init"
I tried this:
load(io.popen("oh-my-posh.exe prompt init cmd -config "..os.getenv("EnvScripts").."\\AutoRun\\posh-prompt.json"):read("*a"))()
But got this:
Error: invalid argument "D:\\mdnava\\OneDrive\\Command\\EnvScripts\\AutoRun\\posh-prompt.json" for "oh-my-posh prompt init"
What am I doing wrong with the args ?
@mdnava you need to use --config
.
load(io.popen('oh-my-posh prompt init cmd --config="..os.getenv("EnvScripts").."\\AutoRun\\posh-prompt.json"'):read("*a"))()
Nevermind, is working now.. I had been using -config instead of --config for quite some time. I suppose it stopped working after v7.37 ..
Thank you!
@mdnava the previous CLI implementation allowed the use of -config
, that's now no longer possible. You can use -c
now though.
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. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
The OhMyPosh prompt stopped working on Cmd after v7.37.0 .. But works fine on Pwsh, Bash and Fish.
The last version I'm able to use it is v7.37.0 .. I've tried every version after that (up to v7.41.0) in case the issue was fixed, but the only way I can seem to be able to use it with Cmd is to rollback to the older version.
This is the Clink injection in the Cmd Autorun file:
%Utilities%\Clink\Clink\clink_x64.exe inject --quiet --nolog
This is the LUA code that starts the prompt..
——————————————— Also, please check comment on issue https://github.com/JanDeDobbeleer/oh-my-posh/issues/1907#issuecomment-1065973832 related to Zsh.. OhMyPosh is adding up something to the beginning of every prompt in Zsh. In my case it was the "%" character, and in your test it seems it was the "zsh>" string.
Theme
What OS are you seeing the problem on?
Windows
Which shell are you using?
zsh, bash, fish, powershell, other (please specify)
Log output