Skip to content

Commit

Permalink
Add $GitPromptSettings.AnsiConsole
Browse files Browse the repository at this point in the history
- Enabled if $Host.UI.SupportsVirtualTerminal
- Enabled if %ConEmuANSI% is 'ON'
- Can be manually set in $PROFILE for other ANSI-capable consoles
  • Loading branch information
dahlbyk committed Sep 21, 2016
1 parent ad3d071 commit 5271273
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ $global:GitPromptSettings = New-Object PSObject -Property @{

EnableWindowTitle = 'posh~git ~ '

AnsiConsole = $Host.UI.SupportsVirtualTerminal -or ($Env:ConEmuANSI -eq "ON")

Debug = $false

BranchNameLimit = 0
Expand All @@ -106,7 +108,7 @@ if (Get-Module NuGet) {
}

function Write-Prompt($Object, $ForegroundColor, $BackgroundColor = -1) {
if ($Host.UI.SupportsVirtualTerminal) {
if ($GitPromptSettings.AnsiConsole) {
$e = [char]27 + "["
$f = Get-ForegroundVirtualTerminalSequence $ForegroundColor
$b = Get-BackgroundVirtualTerminalSequence $BackgroundColor
Expand Down

0 comments on commit 5271273

Please sign in to comment.