Closed underlines closed 2 hours ago
Found your issue in PowerShell/PowerShell
[Console]::OutputEncoding = [Text.Encoding]::UTF8
fixed it, when added to $PROFILE
before the OMP invokation.
So my init script now looks like this:
[Console]::OutputEncoding = [Text.Encoding]::UTF8
oh-my-posh init pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression
Import-Module -Name Terminal-Icons
If you compare both outputs exactly in my log output it really seems to be an encoding problem as you noted:
jb ~
Windows PowerShell legacy¯é jb ¯é░¯é░ ¯¬â ~ ¯é░¯é░ ´Çî ¯é
Microsoft PowerShell 7 jb ~
Microsoft PowerShell 7 after changing text encoding to UTF8@underlines this is a PowerShell UTF8 issue they currently still refuse to fix. We can't solve that. You'll need to force the shell to UTF8 before initializing oh-my-posh.
Code of Conduct
What happened?
First of all: OMP is awesome and I use it for years. Love your work. I use it without problems in Windows Terminal + Windows PowerShell (the legacy one). But recently I had to move to MS
pwsh
(the open source one) and noticed it doesn't work (it never did on my machine, even on older versions).System
pwsh
doesn't work (tried MS Store and winget Version)Windows PowerShell
$PROFILE content:
Write-Host $error
emptydebug
oh-my-posh debug pwsh
visual:
MS pwsh 7.4.5:
$PROFILE content:
Write-Host $error
emptydebug
oh-my-posh debug pwsh
visual:
Theme
default: jandedobbeleer.omp.json
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output