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

Write-Prompt 0.7.1 from PSGallery does not allow -ForegroundColor Black #470

Closed
ayrtonmassey opened this issue May 17, 2017 · 4 comments
Closed
Milestone

Comments

@ayrtonmassey
Copy link

System Details

  • posh-git version/path: 0.7.1 from the PowerShell Gallery.
  • PowerShell version: 5.1.14393.1198
  • Git version: 2.7.1.windows.2
  • Operating system name and version:
    • Edition: Windows 10 Enterprise
    • Version: 1607
    • Build: 14393.1198

Issue Description

Write-Prompt checks to see if the $ForegroundColor parameter is empty by performing the check !$ForegroundColor. This works in all cases except when $ForegroundColor is [ConsoleColor]::Black, since Black evaluates to 0 and !0 == True.

The offending line is posh-git/src/GitPrompt.ps1:135:

function Write-Prompt($Object, $ForegroundColor = $null, $BackgroundColor = $null) {
    $s = $global:GitPromptSettings
    if ($s -and !$ForegroundColor) {
        $ForegroundColor = $s.DefaultForegroundColor
    }

I see that this was fixed by #454 on GitHub (the condition is now ($null -eq $ForegroundColor)) but the copy I obtained from PSGallery via Install-Module earlier today does not have this fix.

@dahlbyk
Copy link
Owner

dahlbyk commented May 17, 2017

This was actually fixed by #468, which has not been released yet. I'll try to make that happen 🔜

@bergmeister
Copy link
Contributor

@dahlbyk When is 0.7.2 getting released?

@dahlbyk
Copy link
Owner

dahlbyk commented Dec 18, 2017

When is 0.7.2 getting released?

Probably next week while I'm off work. 🎄

@dahlbyk
Copy link
Owner

dahlbyk commented Jan 10, 2018

https://www.powershellgallery.com/packages/posh-git/0.7.2-pre1 is available now; the release will be finalized soon. Sorry for the delay!

@dahlbyk dahlbyk closed this as completed Jan 10, 2018
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

3 participants