Skip to content

Commit

Permalink
Make Window Title prefix configurable
Browse files Browse the repository at this point in the history
To enable the posh-git title with no prefix:
$GitPromptSettings.EnableWindowTitle = $true

To use a custom prefix:
$GitPromptSettings.EnableWindowTitle = 'Cool: '

Also, dashes have been removed from default prefix due to Console2 bug:
http://sourceforge.net/projects/console/forums/forum/143117/topic/3949992
  • Loading branch information
dahlbyk committed Mar 23, 2013
1 parent 9232f70 commit 1ed6d4d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $global:GitPromptSettings = New-Object PSObject -Property @{
EnableFileStatus = $true
RepositoriesInWhichToDisableFileStatus = @( ) # Array of repository paths

EnableWindowTitle = $true
EnableWindowTitle = 'posh~git ~ '

Debug = $false
}
Expand Down Expand Up @@ -131,7 +131,8 @@ function Write-GitStatus($status) {
$Global:PreviousWindowTitle = $Host.UI.RawUI.WindowTitle
}
$repoName = Split-Path -Leaf (Split-Path $status.GitDir)
$Host.UI.RawUI.WindowTitle = "posh-git - $repoName [$($status.Branch)]"
$prefix = if ($s.EnableWindowTitle -is [string]) { $s.EnableWindowTitle } else { '' }
$Host.UI.RawUI.WindowTitle = "$prefix$repoName [$($status.Branch)]"
}
} elseif ( $Global:PreviousWindowTitle ) {
$Host.UI.RawUI.WindowTitle = $Global:PreviousWindowTitle
Expand Down

0 comments on commit 1ed6d4d

Please sign in to comment.