Closed Bilge closed 3 months ago
@Bilge did you install as admin? Because we'll never have permissions in this case. I'll try to add that safety check in here because IMHO, that's exactly what happens. Running sudo oh-my-posh upgrade
will work.
It's been a while, but it seems I installed with Chocolatey, which I believe requires admin privileges. But this is not a privilege escalation issue, I don't think; the UAC prompt has already appeared by that point and works as expected. The issue is the upgrade process is blocking waiting for the upgrade to complete, but it doesn't complete because it can't overwrite the blocking process! If it just returned instead of blocking, it could be overwritten by the upgrade utility.
@Bilge you're still using the "older" upgrade way that uses the installer. That's also why you saw the UAC, that one indeed had this issue. The new way uses a different technique and no longer has this bug, however, and that's fixed in the linked PR, it doesn't provide that feedback to the user (nicely). It does now. You still won't be able to use the CLI to upgrade oh-my-posh that was installed system wide as a user though, we can't popup an elevated prompt from golang, but at least we'll tell you :-)
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?
It's very neat that the auto-update feature works, even on Windows, except that it doesn't because it always tries to replace the binary when it's still in use.
This seems to be because the upgrade command blocks during this upgrade process. There is no need to quit any terminals, but the upgrade command itself must be manually terminated with
CTRL+C
before "try again" will succeed.Probably this could be fixed simply by not blocking waiting for the upgrade sub-process to finish before the parent
oh-my-posh.exe
process exits.Theme
n/a
What OS are you seeing the problem on?
Windows
Which shell are you using?
bash
Log output