-
-
Notifications
You must be signed in to change notification settings - Fork 813
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
Powershell 7.3.0 does not show posh-git status bar #932
Comments
I can confirm the same issue with the same versions mentioned above. My temporary workaround is to use the Windows PowerShell profile (being version 5.1.19041) within Windows Terminal, instead of PowerShell (Core). The posh-git status bar shows as expected there. |
When I turned on tracing, I found that this line is not setting the status variable at all: Line 331 in b8c1f17
|
Same issue here with PowerShell 7.3.0 |
I'm using PowerShell 7.3.1 and seeing the same issue. |
I think I found a workaround. If you replace lines 326-331 in ./src/GitUtils.ps1 with the code below, it works. For some reason, I needed to get rid of the "2" after the branch argument in the status command, as well as the ">$null". Git doesn't like having an empty string in the pathspec argument either, hence not including $untrackedFilesOption when it's empty. Lines 326 to 331 in b8c1f17
$psMajor = $($PSVersionTable.PSVersion.Major) -as [int]
$psMinor = $($PSVersionTable.PSVersion.Minor) -as [int]
$status = $null
$untrackedFilesOption = if ($settings.UntrackedFilesMode) { "-u$($settings.UntrackedFilesMode)" } else { "" }
if (($psMajor -ge 7 -and $psMinor -ge 3) -or $psMajor -gt 7) {
if ($untrackedFilesOption.Length -gt 0) {
$status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status $untrackedFilesOption --short --branch }
}
else {
$status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status --short --branch }
}
}
else {
$status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status $untrackedFilesOption --short --branch 2>$null }
} |
Confirmed fixed in PS 7.3.x, also works in previous versions. My code replacement in GitUtils.ps1 was slightly different: Replace this line (236ish) with @tcomben s fix: $status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status $untrackedFilesOption --short --branch 2>$null } |
I realised I encountered this issue because I installed poshgit using chocolatey, which, according to https://community.chocolatey.org/packages/poshgit, it's latest version stalled at 0.7.3.1. Installing latest via
fixed it for me. Reference: |
System Details
Issue Description
I am experiencing a problem with Powershell 7.30 in windows terminal (ver 1.15.2875.0) specifically that the status bar oes not appear in folders with git repository.
Troubleshooting done so far:
My suspision would be that the methods to add the status bar to the PowerShell promt have changed because of the autotabbing for git working as usual.
The text was updated successfully, but these errors were encountered: