From 1ed6d4d3c26059c5b0abbd33708dde2be70ad8f2 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Fri, 22 Mar 2013 22:55:35 -0500 Subject: [PATCH] Make Window Title prefix configurable 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 --- GitPrompt.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GitPrompt.ps1 b/GitPrompt.ps1 index 1978925a2..bca7bc6d9 100644 --- a/GitPrompt.ps1 +++ b/GitPrompt.ps1 @@ -46,7 +46,7 @@ $global:GitPromptSettings = New-Object PSObject -Property @{ EnableFileStatus = $true RepositoriesInWhichToDisableFileStatus = @( ) # Array of repository paths - EnableWindowTitle = $true + EnableWindowTitle = 'posh~git ~ ' Debug = $false } @@ -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