Default color instead of white as foreground #17757

Open
opened 2026-01-31 05:52:30 +00:00 by claunia · 0 comments
Owner

Originally created by @ADIX7 on GitHub (Jun 20, 2022).

Windows Terminal version

1.14.1451.0

Windows build number

10.0.19043.0

Other Software

No response

Steps to reproduce

With this tool you can render the color palett

Console.WriteLine("Hello, World!");
for (var i = 0; i < 8; i++)
{
    Console.ForegroundColor = (ConsoleColor)i;
    Console.Write("Hello, World!");
    Console.ForegroundColor = (ConsoleColor)(i + 8);
    Console.WriteLine("\tHello, World!");
}

Console.WriteLine();

for (var i = 0; i < 8; i++)
{
    Console.ForegroundColor = (ConsoleColor)ShiftColor(i);
    Console.BackgroundColor = (ConsoleColor)i;
    Console.Write("Hello, World!");

    Console.ResetColor();
    Console.Write("\t");

    Console.ForegroundColor = (ConsoleColor)ShiftColor(i + 8);
    Console.BackgroundColor = (ConsoleColor)(i + 8);
    Console.Write("Hello, World!");
    Console.ResetColor();
    Console.WriteLine();
}

static int ShiftColor(int c)
{
    var result = c + 8;
    while (result > 15) result = c -= 8;
    while (result < 0) result = c += 8;

    return result;
}

Expected Behavior

When using white as foreground color, white ("white" attribute in scheme config) should be used instead of the "default" foreground ("foreground" attribute in scheme config)

Actual Behavior

Currently the default foreground color is used even when the foreground color is set to white.

After running in the attached snippet it is obvious that the white foreground (1st block 1st column last row) and the white background (2nd block 1st column last row) are not the same, on the other hand the first "Hello World" has the same colors as the one with white foreground (1st block 1st column last row)

kép

Originally created by @ADIX7 on GitHub (Jun 20, 2022). ### Windows Terminal version 1.14.1451.0 ### Windows build number 10.0.19043.0 ### Other Software _No response_ ### Steps to reproduce With this tool you can render the color palett ```csharp Console.WriteLine("Hello, World!"); for (var i = 0; i < 8; i++) { Console.ForegroundColor = (ConsoleColor)i; Console.Write("Hello, World!"); Console.ForegroundColor = (ConsoleColor)(i + 8); Console.WriteLine("\tHello, World!"); } Console.WriteLine(); for (var i = 0; i < 8; i++) { Console.ForegroundColor = (ConsoleColor)ShiftColor(i); Console.BackgroundColor = (ConsoleColor)i; Console.Write("Hello, World!"); Console.ResetColor(); Console.Write("\t"); Console.ForegroundColor = (ConsoleColor)ShiftColor(i + 8); Console.BackgroundColor = (ConsoleColor)(i + 8); Console.Write("Hello, World!"); Console.ResetColor(); Console.WriteLine(); } static int ShiftColor(int c) { var result = c + 8; while (result > 15) result = c -= 8; while (result < 0) result = c += 8; return result; } ``` ### Expected Behavior When using white as foreground color, white ("white" attribute in scheme config) should be used instead of the "default" foreground ("foreground" attribute in scheme config) ### Actual Behavior Currently the default foreground color is used even when the foreground color is set to white. After running in the attached snippet it is obvious that the white foreground (1st block 1st column last row) and the white background (2nd block 1st column last row) are not the same, on the other hand the first "Hello World" has the same colors as the one with white foreground (1st block 1st column last row) ![kép](https://user-images.githubusercontent.com/10939090/174675411-2e7a254d-c7bf-4c03-8234-76dad18953da.png)
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 05:52:31 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17757