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

Importing posh-git shows empty prompt #952

Open
PatrickKa opened this issue Mar 17, 2023 · 0 comments
Open

Importing posh-git shows empty prompt #952

PatrickKa opened this issue Mar 17, 2023 · 0 comments

Comments

@PatrickKa
Copy link

System Details

  • posh-git version/path: 1.1.0
  • PowerShell version: 5.1.19041.2673
  • Git version: 2.37.3.windows.1
  • Operating system name and version: Microsoft Windows NT 10.0.19044.0

Issue Description

Since yesterday posh-git does not work properly anymore. By that I mean that instead of adding Git information to the prompt it sets it to an empty one only showing PS>.

PS D:\Path\To\A\Git\Repository>
PS D:\Path\To\A\Git\Repository> Import-Module posh-git
PS>
PS>Remove-Module posh-git
PS D:\Path\To\A\Git\Repository>

I have no experience with writing powershell scripts but I tried debugging the issue by putting various Write-Warning statements in the code. It turns out that

Set-ConsoleMode -ANSI

causes the problem. Any Write-Warning statements after that line were not printed. If I comment it out, the Git info is displayed correctly again.

PS D:\Path\To\A\Git\Repository> Import-Module posh-git
D:\Path\To\A\Git\Repository [master+1 ~11 -0 !]>

I did some more "debugging" and the furthest I got was to

Add-Type $consoleModeSource

where, again, no Write-Warning statements were printed after that. I don't really know what this means or how adding that type can suddenly cause problems from one day to the other. The only thing that happened between Wednesday (where everything worked) and Thursday (where this issue first appeared) is that I uninstalled miniconda, Qt and a few other programs and then installed miniconda again. Appart from PATH shenanigans I have no idea how that would cause this issue though.

Anyway, since everything seems to work, if I comment out Set-ConsoleMode -ANSI, this is not a pressing/urgent issue for me. I am still curious though if anyone can tell me how to properly fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant