Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 1a14295

Browse files
committed
Detect initial bolding for console colors
1 parent 451e9e6 commit 1a14295

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Microsoft.DotNet.Cli.Utils/AnsiConsole.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ namespace Microsoft.DotNet.Cli.Utils
88
{
99
public class AnsiConsole
1010
{
11+
private const int Light = 0x08;
12+
1113
private AnsiConsole(TextWriter writer)
1214
{
1315
Writer = writer;
1416

1517
OriginalForegroundColor = Console.ForegroundColor;
18+
_boldRecursion = ((int)OriginalForegroundColor & Light) != 0 ? 1 : 0;
1619
}
1720

1821
private int _boldRecursion;
@@ -33,7 +36,6 @@ public static AnsiConsole GetError()
3336

3437
private void SetColor(ConsoleColor color)
3538
{
36-
const int Light = 0x08;
3739
int c = (int)color;
3840

3941
Console.ForegroundColor =

0 commit comments

Comments
 (0)