Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powerline Glyphs replaced with other characters when Out-File used #220

Closed
2 tasks done
ghost opened this issue Dec 3, 2020 · 7 comments
Closed
2 tasks done

Powerline Glyphs replaced with other characters when Out-File used #220

ghost opened this issue Dec 3, 2020 · 7 comments

Comments

@ghost
Copy link

ghost commented Dec 3, 2020

Prerequisites

  • I have read and understand the CONTRIBUTING guide
  • 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

@JanDeDobbeleer
Copy link
Owner

@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

@JanDeDobbeleer
Copy link
Owner

@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

@ghost
Copy link
Author

ghost commented Dec 5, 2020

Thank you

@boarder2
Copy link
Contributor

boarder2 commented Jan 9, 2021

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

@JanDeDobbeleer
Copy link
Owner

@boarder2 fair point, we do accept contributions 😉

boarder2 added a commit to boarder2/oh-my-posh3 that referenced this issue Jan 9, 2021
JanDeDobbeleer pushed a commit that referenced this issue Jan 9, 2021
@JanDeDobbeleer
Copy link
Owner

@boarder2 🙏🏻

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants