powershellterminaloh-my-posh

Oh-My-Posh Powershell random characters in promt


I am using Powershell 7.4.4 in Windows Terminal on Windows 10 and trying to set up Oh-My-Posh. I am using a nerd font (Lilex). Other than using a different font, I have followed the setup procedure in the Oh-My-Posh docs exactly. I even went back and tried using the reccomended font and it has the same problem.

When I run oh-my-posh init powershell | Invoke-Expression I get characters that are rendered just fine, but the appear to be random unicode characters as if the mapping is off or something.

Image of issue

After running the oh-my-posh init powershell | Invoke-Expression command I am expecting a prompt interface that looks something like this: enter image description here


Solution

  • To anyone else who ends up here - @jdweng was correct. I had miss-understood the documentation in the FAQ talking about this. Powershell 7 does already use UTF-8 (kind of), but there is some bug in recent (7.4) versions. There was no image of what this issue looks like, so I thought it was referring to something else. There is an ongoing bug report with MS to try to fix this in Powershell.