Oh-my-posh3: Powerline Glyphs replaced with other characters when Out-File used

Created on 3 Dec 2020  路  6Comments  路  Source: JanDeDobbeleer/oh-my-posh3

Prerequisites

  • [x] I have read and understand the CONTRIBUTING guide
  • [x] I looked for duplicate issues before submitting this one

Description

Writing stock theme with Out-File replaces powerline glyphs with odd characters
[Description of the bug or feature]

Environment

  • Oh my Posh version: 3.46.1
  • Theme: emodipt
  • Operating System: Win10
  • Shell: pwsh
  • Terminal: Windows Terminal

Steps to Reproduce

  1. Set-PoshPrompt -Theme emodipt
  2. Write-PoshTheme | Out-File -FilePath ~/.go-my-posh.json
  3. Set-PoshPrompt -Theme ~/.go-my-posh.json

Expected behavior: [What you expected to happen]
Custom prompt should look the same as stock emodipt
image

Actual behavior: [What actually happened]
Powerline Glyphs aren't rendered properly
image

All 6 comments

@otaconjh this is a first guess, I'll look into it later today, but I think you need to set the encoding to utf8 in Out-File.

-Encoding utf8

@otaconjh confirmed on my machine to be working with the proper encoding, although it's oem:

  1. Write-PoshTheme | Out-File -FilePath ~/.go-my-posh.json -Encoding oem

Thank you

Encoding works, might be worth updating the doc on the website with it! https://ohmyposh.dev/docs/upgrading

@boarder2 fair point, we do accept contributions 馃槈

@boarder2 馃檹馃徎

Was this page helpful?
0 / 5 - 0 ratings