oh-my-posh: Failure trying to install Oh My Posh

Code of Conduct

  • I agree to follow this project’s Code of Conduct

What happened?

I was trying to install oh-my-posh, succeeded on one computer but for whatever reason, when tried to replicate the process on another computer it failed.

Find here an image about the process I followed: image

Theme

Installation Failed

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

No logs, installation failed

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 43 (22 by maintainers)

Most upvoted comments

@FabianEscarate found it, crashes on PowerShell 5…I’m close to dropping support for that ancient tool…

@manmartgarc chmod: cannot access '/usr/local/bin/oh-my-posh': No such file or directory implies it failed to download/extract to that location so I’d expect another error line or output above.

Yeah, sorry I just put the two lines in the output that seemed like stderr.

I tried running the installation on a fresh Ubuntu 22.04 install when I got these errors.

I have since gotten rid of Ubuntu and set up Windows 11 with WSL, and had no issues with the installation on both Windows and Ubuntu (WSL).

Sorry I couldn’t help more trying to debug the issue on Ubuntu.

I got extremely frustrated, then tried to set it up on my take-everywhere laptop and worked without any issues at all… I’ll probably just delete the bashrc file from my other computer and do it from scratch 😃 Will keep you posted. Thanks in advance for the tons of help!

@JanDeDobbeleer but it works in pwsh core 🙃

https://github.com/PowerShell/vscode-powershell/issues/1308

Ok so:

  • if the file is saved in UTF-8 without bom, it fails in pwsh 5.1 but works in pwsh 7
  • if the file is saved in UTF-8 with bom, it works in both(with the em dash) so it seems the encoding detection is somewhat different between 5.1 and 7

https://stackoverflow.com/questions/55049410/powershell-script-runs-when-pasted-into-the-powershell-window-but-not-when-run explanation here:https://docs.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/understanding-file-encoding?view=powershell-7.2#configuring-powershell

I nailed it: the dash you set before passthru is not a dash(https://www.fileformat.info/info/unicode/char/2d/index.htm), it’s an en dash(https://www.fileformat.info/info/unicode/char/2013/index.htm) image

I just tried on the computer where I installed it at first, it also breaks, it seems I hadn’t restarted PS, somehow I got 6.17 first there so it worked just fine at first but broke after updating it. Hope the feedback is useful!

I can’t reproduce this:

image

Can you try to install again? Maybe something went wrong in the underlying PowerShell install logic?