Closed dact221 closed 2 years ago
Here's the error message returned when trying to locate the exe file:
Have to check why Stat
is not working in that scenario.
I found that the file julia.exe at %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
is an NTFS reparse point. Using the fsutil
tool I got the target file:
C:\Program Files\WindowsApps\JuliaComputingInc.Julia_1.2.16.0_x64__b0ra4bp6jsp6c\Julia\julialauncher.exe
I hope it helps.
This issue is already reported on the golang repo: https://github.com/golang/go/issues/42919
I wonder if it is possible to find an OhMyPosh-side workaround.
If it's lookpath
that fails, we won't be able to work around that. @lnu were you able to see which call fails?
@lnu that means we can't fix this as LookPath is also used when running a command.
@dact221 metioned this opened golang issue: golang/go#42919
And yes that will be too much investment for platform specific bug of go itself
Closing this in favour of tracking golang/go#42919
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?
Dear developers,
I installed Oh My Posh in Windows 11 through winget and created a custom theme. I also installed Julia through the Microsoft Store and the executable is at
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
(in %PATH%). However, the Julia segment was unable to determine the Julia version.I tried installing the official Julia binaries from julialang.org/downloads and added them to %PATH% (
%LOCALAPPDATA%\Programs\Julia-1.6.4\bin
), and now the Julia segment works fine.I was confused by the fact that Oh My Posh can find the julia executable installed by the official method but not the one installed through the Microsoft Store. Both versions are in %PATH%, and both of them runs fine for me on the command line. Then, I read Oh My Posh's code and found that the Go function
exec.LookPath
causes the issue.I inspected the Julia executable at
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
and found that it's zero 0 bytes in size. However, this file works fine when executed from the command line; I think it is some kind of weird symlink.exec.LookPath
attempts to follow the link and perform a stat system call (os.Stat) on it (source code) but fails in the process.I'm not sure how much difficult would it be to implement a way to look for the Julia executable without using
exec.LookPath
, but I think it would solve the issue.Theme
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output