Skip to content

7.4: prompt function outputs incorrect encoding when using oh-my-posh #20733

@JanDeDobbeleer

Description

@JanDeDobbeleer

Prerequisites

Steps to reproduce

A 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.

Doesn't work:

oh-my-posh init pwsh --config ~/custom.omp.json | Invoke-Expression

Works:

[Console]::OutputEncoding = [Text.Encoding]::UTF8
oh-my-posh init pwsh --config ~/custom.omp.json | Invoke-Expression

Expected behavior

It displays the prompt without issues

Actual behavior

You can see garbled text

Error details

Not applicable

Environment data

$PSVersionTable
Name
Value
PSVersion
7.4.0
PSEdition
Core
GitCommitId
7.4.0
OS
Microsoft Windows 10.0.22000
Platform
Win32NT
PSCompatibleVersions
4.0....)
{1.0, 2.0, 3.0, 4.0....®
PSRemotingProtocolVersion
2.3
SerializationVersion
1.1.0.1
WSManStackVersion
3.0

Visuals

Linked issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    KeepOpenThe bot will ignore these and not auto-closeWG-Interactive-Consolethe console experienceWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions