Skip to content

Replace or improve $GitPromptSettings #344

@rkeithhill

Description

@rkeithhill

It is really hard to find a setting in the output of $GitPrompSettings:

LocalWorkingStatusForegroundColor         : DarkRed
FileModifiedText                          : ~
AfterStashBackgroundColor                 : Black
WorkingForegroundBrightColor              : Red
RepositoriesInWhichToDisableFileStatus    : {}
IndexForegroundColor                      : DarkGreen
BranchForegroundColor                     : Cyan
BeforeStashForegroundColor                : Red
EnablePromptStatus                        : True
AfterBackgroundColor                      : Black
FileRemovedText                           : -
BeforeIndexBackgroundColor                : Black
AfterText                                 : ]
BeforeForegroundColor                     : Yellow
LocalWorkingStatusSymbol                  : !
BranchAheadStatusSymbol                   : ↑
LocalDefaultStatusSymbol                  :
IndexForegroundBrightColor                : Green
IndexBackgroundColor                      : Black
LocalStagedStatusForegroundColor          : Cyan
ShowStatusWhenZero                        : True
WorkingForegroundColor                    : DarkRed
BranchIdenticalStatusToBackgroundColor    : Black
BeforeIndexForegroundColor                : DarkGreen
BranchIdenticalStatusToSymbol             : ≡
BranchBehindAndAheadStatusForegroundColor : Yellow
LocalDefaultStatusForegroundColor         : DarkGreen
DescribeStyle                             :
BranchBackgroundColor                     : Black
LocalStagedStatusBackgroundColor          : Black
BranchIdenticalStatusToForegroundColor    : Cyan
AfterStashText                            : )
BeforeBackgroundColor                     : Black
BeforeIndexForegroundBrightColor          : Green
EnableStashStatus                         : False
Debug                                     : False
LocalWorkingStatusForegroundBrightColor   : Red
LocalWorkingStatusBackgroundColor         : Black
LocalStagedStatusSymbol                   : ~
DelimText                                 :  |
BranchBehindAndAheadStatusSymbol          : ↕
WorkingBackgroundColor                    : Black
BeforeStashBackgroundColor                : Black
DefaultForegroundColor                    : Gray
BranchNameLimit                           : 0
AfterForegroundColor                      : Yellow
DelimBackgroundColor                      : Black
BranchBehindStatusForegroundColor         : Red
AfterStashForegroundColor                 : Red
LocalDefaultStatusForegroundBrightColor   : Green
LocalDefaultStatusBackgroundColor         : Black
StashForegroundColor                      : Red
DelimForegroundColor                      : Yellow
TruncatedBranchSuffix                     : ...
FileAddedText                             : +
StashBackgroundColor                      : Black
BranchAheadStatusForegroundColor          : Green
BranchUntrackedSymbol                     :
BranchBehindStatusBackgroundColor         : Black
BranchAheadStatusBackgroundColor          : Black
AutoRefreshIndex                          : True
BeforeText                                :  [
BranchBehindStatusSymbol                  : ↓
EnableWindowTitle                         : posh~git ~
BranchBehindAndAheadStatusBackgroundColor : Black
BeforeIndexText                           :
EnableFileStatus                          : True
BeforeStashText                           :  (
FileConflictedText                        : !

It would be much easier to find related settings if we used an ordered dictionary which preserves insert order (not available in v2 though):

Name                           Value
----                           -----
DefaultForegroundColor         Gray
BeforeText                      [
BeforeForegroundColor          Yellow
BeforeBackgroundColor          Black
DelimText                       |
DelimForegroundColor           Yellow
DelimBackgroundColor           Black
AfterText                      ]
AfterForegroundColor           Yellow
AfterBackgroundColor           Black
FileAddedText                  +
FileModifiedText               ~
FileRemovedText                -
FileConflictedText             !
LocalDefaultStatusSymbol
LocalDefaultStatusForegroun... DarkGreen
LocalDefaultStatusForegroun... Green
LocalDefaultStatusBackgroun... Black
LocalWorkingStatusSymbol       !
LocalWorkingStatusForegroun... DarkRed
LocalWorkingStatusForegroun... Red
LocalWorkingStatusBackgroun... Black
LocalStagedStatusSymbol        ~
LocalStagedStatusForeground... Cyan
LocalStagedStatusBackground... Black
BranchUntrackedSymbol
BranchForegroundColor          Cyan
BranchBackgroundColor          Black
BranchGoneStatusSymbol         ×
BranchGoneStatusForegroundC... DarkCyan
BranchGoneStatusBackgroundC... Black
BranchIdenticalStatusToSymbol  ≡
BranchIdenticalStatusToFore... Cyan
BranchIdenticalStatusToBack... Black
BranchAheadStatusSymbol        ↑
BranchAheadStatusForeground... Green
BranchAheadStatusBackground... Black
BranchBehindStatusSymbol       ↓
BranchBehindStatusForegroun... Red
BranchBehindStatusBackgroun... Black
BranchBehindAndAheadStatusS... ↕
BranchBehindAndAheadStatusF... Yellow
BranchBehindAndAheadStatusB... Black
BeforeIndexText
BeforeIndexForegroundColor     DarkGreen
BeforeIndexForegroundBright... Green
BeforeIndexBackgroundColor     Black
IndexForegroundColor           DarkGreen
IndexForegroundBrightColor     Green
IndexBackgroundColor           Black
WorkingForegroundColor         DarkRed
WorkingForegroundBrightColor   Red
WorkingBackgroundColor         Black
EnableStashStatus              False
BeforeStashText                 (
BeforeStashBackgroundColor     Black
BeforeStashForegroundColor     Red
AfterStashText                 )
AfterStashBackgroundColor      Black
AfterStashForegroundColor      Red
StashBackgroundColor           Black
StashForegroundColor           Red
ShowStatusWhenZero             True
AutoRefreshIndex               True
BranchBehindAndAheadDisplay    Full
EnablePromptStatus             True
EnableFileStatus               True
RepositoriesInWhichToDisabl... {}
DescribeStyle
EnableWindowTitle              posh~git ~
Debug                          False
BranchNameLimit                0
TruncatedBranchSuffix          ...

And yeah, the ordered dictionary is a different type than a PSCustomObject but you can dot the kv pairs in PowerShell as if it were a property e.g. $GitPromptSettings.EnableFileStatus.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions