Skip to content

Commit

Permalink
fix: Address review comments
Browse files Browse the repository at this point in the history
Co-Authored-By: Keith Hill <[email protected]>
  • Loading branch information
ExE-Boss and rkeithhill committed Apr 21, 2019
1 parent 46296b7 commit 4450136
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function Write-Prompt {
}
else {
# If we know which colors were changed, we can reset only these and leave others be.
[System.Collections.Generic.List[string]]$reset = @()
$reset = [System.Collections.Generic.List[string]]::new()
$e = [char]27 + "["

$fg = $fgColor
Expand All @@ -133,7 +133,8 @@ function Write-Prompt {

$str = "${Object}"
if (Test-VirtualTerminalSequece $str -Force) {
$reset = @('0')
$reset.Clear()
$reset.Add('0')
}

$str = "${fg}${bg}" + $str
Expand Down
5 changes: 3 additions & 2 deletions src/PoshGitTypes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class PoshGitTextSpan {
# implementation to display any ANSI seqs when AnsiConsole is $true.
[string] ToAnsiString() {
# If we know which colors were changed, we can reset only these and leave others be.
[System.Collections.Generic.List[string]]$reset = @()
$reset = [System.Collections.Generic.List[string]]::new()
$e = [char]27 + "["

$fg = $this.ForegroundColor
Expand All @@ -175,7 +175,8 @@ class PoshGitTextSpan {
# ALWAYS terminate a VT sequence in case the host supports VT (regardless of AnsiConsole setting),
# or the host display can get messed up.
if (Test-VirtualTerminalSequece $txt -Force) {
$reset = @('0')
$reset.Clear()
$reset.Add('0')
}

if ($reset.Count -gt 0) {
Expand Down

0 comments on commit 4450136

Please sign in to comment.