Title: 7.4: prompt function outputs incorrect encoding when using oh-my-posh · Issue #20733 · PowerShell/PowerShell · GitHub
Open Graph Title: 7.4: prompt function outputs incorrect encoding when using oh-my-posh · Issue #20733 · PowerShell/PowerShell
X Title: 7.4: prompt function outputs incorrect encoding when using oh-my-posh · Issue #20733 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/20733
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"7.4: prompt function outputs incorrect encoding when using oh-my-posh","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nA lot of oh-my-posh users are reporting issues with incorrect prompt rendering since the upgrade to 7.4. On our end, nothing changed in that area and I'm unable to reproduce this myself. What we do know is that changing the encoding overall to UTF8 solves the issue, which is why we're thinking in that direction. It's also only for icons in a specific range apparently.\r\n\r\nDoesn't work:\r\n\r\n```powershell\r\noh-my-posh init pwsh --config ~/custom.omp.json | Invoke-Expression\r\n```\r\n\r\nWorks:\r\n\r\n```powershell\r\n[Console]::OutputEncoding = [Text.Encoding]::UTF8\r\noh-my-posh init pwsh --config ~/custom.omp.json | Invoke-Expression\r\n```\r\n\r\n### Expected behavior\r\n\r\n```console\r\nIt displays the prompt without issues\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\nYou can see garbled text\r\n```\r\n\r\n\r\n### Error details\r\n\r\n```console\r\nNot applicable\r\n```\r\n\r\n\r\n### Environment data\r\n\r\n```powershell\r\n$PSVersionTable\r\nName\r\nValue\r\nPSVersion\r\n7.4.0\r\nPSEdition\r\nCore\r\nGitCommitId\r\n7.4.0\r\nOS\r\nMicrosoft Windows 10.0.22000\r\nPlatform\r\nWin32NT\r\nPSCompatibleVersions\r\n4.0....)\r\n{1.0, 2.0, 3.0, 4.0....®\r\nPSRemotingProtocolVersion\r\n2.3\r\nSerializationVersion\r\n1.1.0.1\r\nWSManStackVersion\r\n3.0\r\n```\r\n\r\n\r\n### Visuals\r\n\r\nLinked issues:\r\n\r\n- https://discord.com/channels/1023597603331526656/1176109431382081546\r\n- https://github.com/JanDeDobbeleer/oh-my-posh/issues/4475 (pwsh 5, but same issue so could also be related to PSReadline perhaps?)\r\n- https://github.com/JanDeDobbeleer/oh-my-posh/issues/4468\r\n- https://github.com/JanDeDobbeleer/oh-my-posh/issues/4499\r\n- https://github.com/JanDeDobbeleer/oh-my-posh/issues/5665\r\n- https://github.com/JanDeDobbeleer/oh-my-posh/issues/5662","author":{"url":"https://github.com/JanDeDobbeleer","@type":"Person","name":"JanDeDobbeleer"},"datePublished":"2023-11-20T18:24:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":36},"url":"https://github.com/20733/PowerShell/issues/20733"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:71efab71-b415-7fdb-5892-a2992f010484 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CE2E:EEDD6:6267A3:885D42:6A57D624 |
| html-safe-nonce | 99f947a6b08130baea9e283604eb2bf3960ed9ede54369631e3cdee7623b9451 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTJFOkVFREQ2OjYyNjdBMzo4ODVENDI6NkE1N0Q2MjQiLCJ2aXNpdG9yX2lkIjoiMzA5MDEzNDMwMTU4NzAwMjkxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e296a378c3573ac68b27140a946fe0bbeb81bb0d71bdd57b2fc4bb3b7519db94 |
| hovercard-subject-tag | issue:2002765267 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/20733/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01c4af04998c5e82dc3fabf088e99202772accafefd94b89dab1730f5c18f894/PowerShell/PowerShell/issues/20733 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01c4af04998c5e82dc3fabf088e99202772accafefd94b89dab1730f5c18f894/PowerShell/PowerShell/issues/20733 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JanDeDobbeleer |
| hostname | github.com |
| expected-hostname | github.com |
| None | 837767abbd14b05f219fd812ef2842c659968b63619e1b966dded83972ab5bca |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9044d0f867aa9892268d1f430238ff123e11ee91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width