mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 03:24:04 -08:00
feat: enable posh-git on $GitPromptSettings.EnablePromptStatus
relates to https://github.com/dahlbyk/posh-git/issues/883
This commit is contained in:
parent
c7b681a2b5
commit
749eb6cf26
|
@ -10,7 +10,6 @@ Display the [posh-git][posh-git] prompt.
|
|||
|
||||
:::caution
|
||||
This segment only works within Powershell and requires the posh-git module to be installed and imported.
|
||||
To enable the `posh-git` module, set `$env:POSH_GIT_ENABLED = $true` in your `$PROFILE`.
|
||||
:::
|
||||
|
||||
## Sample Configuration
|
||||
|
|
|
@ -57,11 +57,9 @@ function global:Get-PoshContext {
|
|||
}
|
||||
|
||||
function global:Initialize-ModuleSupport {
|
||||
if ($env:POSH_GIT_ENABLED -eq $true -and (Get-Module -Name "posh-git")) {
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSProvideCommentHelp', '', Justification = 'Variable used later (not in this scope)')]
|
||||
if ($GitPromptSettings.EnablePromptStatus) {
|
||||
$global:GitStatus = Get-GitStatus
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSProvideCommentHelp', '', Justification = 'Variable used by posh-git (not in this script)')]
|
||||
$GitPromptSettings = $null
|
||||
$GitPromptSettings.EnablePromptStatus = $false
|
||||
$env:POSH_GIT_STATUS = Write-GitStatus -Status $global:GitStatus
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue