Skip to content

Commit

Permalink
Merge pull request #538 from nebosite/master
Browse files Browse the repository at this point in the history
Added Setting to change Admin text in window title.
  • Loading branch information
dahlbyk authored Apr 20, 2018
2 parents 5e1c907 + 3066ac7 commit db46cdb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ $global:GitPromptSettings = [pscustomobject]@{
DescribeStyle = ''

EnableWindowTitle = 'posh~git ~ '
AdminTitlePrefixText = 'Administrator: '

DefaultPromptPrefix = ''
DefaultPromptSuffix = '$(''>'' * ($nestedPromptLevel + 1)) '
Expand All @@ -117,8 +118,6 @@ $global:GitPromptSettings = [pscustomobject]@{

$isAdminProcess = Test-Administrator

$adminHeader = if ($isAdminProcess) { 'Administrator: ' } else { '' }

$WindowTitleSupported = $true
if (Get-Module NuGet) {
$WindowTitleSupported = $false
Expand Down Expand Up @@ -295,7 +294,8 @@ function Write-GitStatus($status) {
}
$repoName = Split-Path -Leaf (Split-Path $status.GitDir)
$prefix = if ($s.EnableWindowTitle -is [string]) { $s.EnableWindowTitle } else { '' }
$Host.UI.RawUI.WindowTitle = "$script:adminHeader$prefix$repoName [$($status.Branch)]"
$adminHeader = if ($script:isAdminProcess) { $s.AdminTitlePrefixText } else { '' }
$Host.UI.RawUI.WindowTitle = "$adminHeader$prefix$repoName [$($status.Branch)]"
}
} elseif ( $Global:PreviousWindowTitle ) {
$Host.UI.RawUI.WindowTitle = $Global:PreviousWindowTitle
Expand Down

0 comments on commit db46cdb

Please # to comment.