Bug 2029 - Console's bright colors are not displayed in Linux terminals
Summary: Console's bright colors are not displayed in Linux terminals
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-11-14 19:49 UTC by derrickcreamer
Modified: 2015-01-08 13:10 UTC (History)
2 users (show)

Tags: console color
Is this bug a regression?: ---
Last known good build:

Source code to replicate bug (1.33 KB, text/plain)
2011-11-14 19:49 UTC, derrickcreamer

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description derrickcreamer 2011-11-14 19:49:23 UTC
Created attachment 886 [details]
Source code to replicate bug

  In a Console program running in a linux terminal, bright colors(Red,Blue,Cyan,etc.) are not displayed correctly.

Steps to reproduce:
  1. Compile and run attached source code on a linux terminal. (I used tty2 and bash primarily.)

Actual output:
  With bash or sh, printed chars are respectively dark red, dark cyan, and *dark cyan*.

Expected output:
 Three printed chars are respectively dark red, dark cyan, and red.

Version info:
 Windows test done on Windows 7 with Mono 2.10.2
 Linux test done on Arch Linux with Mono 2.10.6 (build Wed Oct 19, 2011).

Speculation and other info:
 On Windows, this program works as expected with both .NET and Mono. (printed chars are dark red, dark cyan, and red)

 With bash and sh, attempts to set ForegroundColor to a bright color seem to do nothing. (printed chars are dark red, dark cyan, and dark cyan)

 With urxvt, only bright colors are printed. This is likely a urxvt setting or bug, and this line is included only for completeness.

Linux terminals often use a slightly different concept for their 16 color support - that of only 8 colors, and a BOLD attribute. My untrained guess is that this is the root cause of this problem.
 (colors 8-15 are typically the brights. The "normal" colors like Red & Cyan are considered bright on Linux.)
Comment 1 Miguel de Icaza [MSFT] 2015-01-08 13:10:32 UTC
This should be fixed with my commit from December.