Closed wekempf closed 10 months ago
I too recently upgraded to PowerShell 7.4.0 and this weird font issue occurred.
I ran the update command using winget
today (2023-11-18) but not fixed
@FrenchMasta this is a PowerShell UTF8 issue, so if they changed something there (maybe Start-Process
encoding) they have a bug on their end. Nothing changed on our end in that area, so please create a bug on their end. As a temporary workaround, the solution here might also apply for this issue.
If it's simply a UTF8 issue, then why does oh-my-posh print ...
display correctly? I wouldn't have posted here if not for this fact.
@wekempf because PSReadline handles things differently under the hood. Lots of annoying quirks due to not being UTF8 by default. If the move to 7.4 changes this behavior, they need to explain exactly what's going on. It's not listed in the changelog. I can't debug PowerShell itself.
@wekempf I had a look on my machine, running 7.4.0 and I can't reproduce this. So, it's either a font issue (non V3 Nerd Font), or an encoding issue. I propose to download and install the latest patched version of the font and try again. If that doesn't work, it's a bug for PowerShell.
I'm noticing the same behavior on 7.4. However, output briefly renders correctly if I hit CTRL+L, but is then obscured again after the next command. Definitely something to do with Powershell, just need to figure out what :)
Update: Setting the output encoding to UTF8 according to this link solved it for me. Just had to remove the finally-block.
$previousOutputEncoding = [Console]::OutputEncoding
[Console]::OutputEncoding = [Text.Encoding]::UTF8
try {
oh-my-posh init pwsh --config ~/theme.omp.json | Invoke-Expression
} finally {
}
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?
Suddenly today my prompt isn't displaying nicely. Not sure what the cause is. PowerShell did get updated, but I'm not sure how that would be causing what I'm seeing.
I have a custom prompt, but all themes seem to have issues with nerd font display (I'm using CaskaydiaCove Nerd Font Mono). For example, using the theme pure.
The strange thing is, I can print the prompt fine.
Theme
Any theme has problems.
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output