Skip to content

Commit

Permalink
Use tilde in title between status/path and PS info
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Apr 20, 2018
1 parent 938d6c8 commit aec5c95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/PoshGitTypes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class PoshGitPromptSettings {
[string[]]$RepositoriesInWhichToDisableFileStatus = @()

[string]$DescribeStyle = ''
[psobject]$WindowTitle = {param($GitStatus, [bool]$IsAdmin) "$(if ($IsAdmin) {'Admin: '})$(if ($GitStatus) {"$($GitStatus.RepoName) [$($GitStatus.Branch)]"} else {Get-PromptPath}) - PowerShell $($PSVersionTable.PSVersion) $([IntPtr]::Size * 8)-bit ($PID)"}
[psobject]$WindowTitle = {param($GitStatus, [bool]$IsAdmin) "$(if ($IsAdmin) {'Admin: '})$(if ($GitStatus) {"$($GitStatus.RepoName) [$($GitStatus.Branch)]"} else {Get-PromptPath}) ~ PowerShell $($PSVersionTable.PSVersion) $([IntPtr]::Size * 8)-bit ($PID)"}

[PoshGitTextSpan]$DefaultPromptPrefix = ''
[PoshGitTextSpan]$DefaultPromptPath = '$(Get-PromptPath)'
Expand Down
8 changes: 4 additions & 4 deletions test/DefaultPrompt.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ Describe 'Default Prompt WindowTitle Tests' {
$homePath = [regex]::Escape((GetHomePath))

[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$repoAdminRegex = '^Admin: posh-git \[master\] - PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
$repoAdminRegex = '^Admin: posh-git \[master\] \~ PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$repoRegex = '^posh-git \[master\] - PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
$repoRegex = '^posh-git \[master\] \~ PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$nonRepoAdminRegex = '^Admin: ' + $homePath + ' - PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
$nonRepoAdminRegex = '^Admin: ' + $homePath + ' \~ PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$nonRepoRegex = '^' + $homePath + ' - PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
$nonRepoRegex = '^' + $homePath + ' \~ PowerShell \d+\.\d+\.\d+(\.\d+|-\S+)? \d\d-bit \(\d+\)$'
}
AfterAll {
$global:PSDefaultParameterValues = $originalDefaultParameterValues
Expand Down

0 comments on commit aec5c95

Please sign in to comment.