Skip to content

"Garbled" character output in PowerShell when launching "git gui" #4921

@patrikhuber

Description

@patrikhuber

Environment

  • OS: Microsoft Windows NT 10.0.18362.0
  • PowerShell version: 6.2.4
  • posh-git version/path: 1.0.0 beta3 ~\Documents\PowerShell\Modules\posh-git\1.0.0
  • git version 2.25.0.windows.1

Steps to reproduce

In a PowerShell, with posh-git and git-for-windows (which includes git gui) installed:

When typing git gui, the git gui window opens, but on the powershell prompt, the encoding of the characters is outputted and the cursor stays on that line. Only after pressing "Enter", the prompt becomes "normal" again.

~\MyProj [mybranch +2 ~2 -0 !]> git gui    <-- nicely colourised
~\MyProj �[93m[�[0m�[96mmybranch�[0m�[31m�[49m +2�[0m�[31m�[49m ~2�[0m�[31m�[49m -0�[0m�[31m !�[0m�[93m]�[0m>    <-- no colours, "weird" output. Have to press "enter" to get prompt to normal again.
~\MyProj [mybranch +2 ~2 -0 !]>    <-- nicely colourised

image

Expected behavior

Quite obvious I think, the PowerShell prompt should output the "normal" prompt with the coloured characters and stuff (from posh-git).

Actual behavior

Stuff like �[93m[�[0m is output (see above/screenshot).

Related issues

I've opened dahlbyk/posh-git#738 first but the author suggested it's likely a git-gui issue. I've then opened prati0100/git-gui#34 but the author said it might likely be a Windows Terminal issue and related to #4809. After posting in #4809, @DHowett-MSFT advised to open a new issue here, as my issue is with PowerShell, and not with git-bash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions