Skip to content
This repository
Browse code

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
  • Loading branch information...
commit 1ed6d4d3c26059c5b0abbd33708dde2be70ad8f2 1 parent 9232f70
Keith Dahlby authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  GitPrompt.ps1
5  GitPrompt.ps1
@@ -46,7 +46,7 @@ $global:GitPromptSettings = New-Object PSObject -Property @{
46 46
     EnableFileStatus          = $true
47 47
     RepositoriesInWhichToDisableFileStatus = @( ) # Array of repository paths
48 48
 
49  
-    EnableWindowTitle         = $true
  49
+    EnableWindowTitle         = 'posh~git ~ '
50 50
 
51 51
     Debug                     = $false
52 52
 }
@@ -131,7 +131,8 @@ function Write-GitStatus($status) {
131 131
                 $Global:PreviousWindowTitle = $Host.UI.RawUI.WindowTitle
132 132
             }
133 133
             $repoName = Split-Path -Leaf (Split-Path $status.GitDir)
134  
-            $Host.UI.RawUI.WindowTitle = "posh-git - $repoName [$($status.Branch)]"
  134
+            $prefix = if ($s.EnableWindowTitle -is [string]) { $s.EnableWindowTitle } else { '' }
  135
+            $Host.UI.RawUI.WindowTitle = "$prefix$repoName [$($status.Branch)]"
135 136
         }
136 137
     } elseif ( $Global:PreviousWindowTitle ) {
137 138
         $Host.UI.RawUI.WindowTitle = $Global:PreviousWindowTitle

0 notes on commit 1ed6d4d

Please sign in to comment.
Something went wrong with that request. Please try again.