Skip to content

Commit 46c47d7

Browse files
authored
Merge pull request #536 from dahlbyk/rkeithhill/reorder-clr-lookup
Lookup HtmlColors before ConsoleColors
2 parents 71a49dd + ea1c6c8 commit 46c47d7

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/AnsiUtils.ps1

+6-4
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,18 @@ function Get-VirtualTerminalSequence ($color, [int]$offset = 0) {
5858

5959
if ($color -is [String]) {
6060
try {
61-
if ($null -ne ($color -as [System.ConsoleColor])) {
62-
$color = [System.ConsoleColor]$color
63-
}
64-
elseif ($ColorTranslatorType) {
61+
if ($ColorTranslatorType) {
6562
$color = $ColorTranslatorType::FromHtml($color)
6663
}
6764
}
6865
catch {
6966
Write-Debug $_
7067
}
68+
69+
# Hard to get here but DarkYellow is not an HTML color but is a ConsoleColor
70+
if (($color -isnot $ColorType) -and ($null -ne ($consoleColor = $color -as [System.ConsoleColor]))) {
71+
$color = $consoleColor
72+
}
7173
}
7274

7375
if ($ColorType -and ($color -is $ColorType)) {

src/posh-git.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ AliasesToExport = @()
6262
PrivateData = @{
6363
PSData = @{
6464
# Tags applied to this module. These help with module discovery in online galleries.
65-
Tags = @('git', 'prompt', 'tab', 'tab-completion', 'tab-expansion', 'tabexpansion')
65+
Tags = @('git', 'prompt', 'tab', 'tab-completion', 'tab-expansion', 'tabexpansion', 'PSEdition_Core')
6666

6767
# A URL to the license for this module.
6868
LicenseUri = 'https://github.com/dahlbyk/posh-git/blob/develop/LICENSE.txt'

0 commit comments

Comments
 (0)