Closed kevinnansoncx closed 1 year ago
@kevinnansoncx the docs state that commands need to be added to a specific file and not ran directly in your terminal. Please follow the guide correctly to get things to work.
As you're the second person to do this, allow me to ask, how come you came to the conclusion that command needs to be run this way?
Sorry Jan, I ran that exact command (and others) as a part of the oh-my-posh-cmd.lua file as directed by the guide. Each time it resulted in the
[string "-- Helper functions..."]:38: attempt to call field 'setenv' (a nil value) error.
In an attempt to help you troubleshoot, I included the output of running that file directly in the command window, which may have confused the issue. I could not get the debug output to show from the command window, so I thought that was the next best thing. Based on the error message. I think that the line "os.setenv("POSH_THEME", 'c:\git\$env:POSH_THEMES_PATH\atomic.omp.json')" is the culprit (it lines up with line 38). Does that help?
@kevinnansoncx ah OK, thanks makes sense now. So, you're mixing PowerShell and CMD logic here by using --config "$env:POSH_THEMES_PATH\atomic.omp.json"
as the path. Lua can't resolve that environment variable so you'll need to add the actual path to the json file.
AND, you're using the wrong version of clink. Needs to be this one.
Thanks so much Jan. It looks like the 'correct' version of Clink resolved it.
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?
I recently received a new PC and was setting up oh-my-posh and was unable to get the prompt to update in cmd. I am using Windows Terminal (and cmd) with Clink and it reports a error on load,
Theme
atomic and default theme.
What OS are you seeing the problem on?
Windows
Which shell are you using?
other (please specify)
Log output