Repository navigation
Description
Description
System.Console does not print colors correctly under terminal emulators using terminfo's direct color mode (AKA 24-bit, truecolor) entries. I understand that there are several other cross platform issues with System.Console (#52374) but none of those directly identify an issue with recognizing direct color mode.
The key obstacle here is not that System.Console does not have 24-bit color support but rather very specifically that colored text generally ends up illegible. For example, TERM=tmux-direct dotnet run no-such-file. Specifically, colored output by dotnet is how I discovered this.
Reproduction Steps
Using
- the sample program from Bright console colors don't work correctly on Linux #23241
- any direct color mode terminal entry from terminfo
- any 24-bit capable terminal emulator
we can print out many color combinations for different TERM values. For example
$ wget https://raw.githubusercontent.com/mirror/ncurses/master/misc/terminfo.src
$ tic -e tmux-direct,tmux-256color terminfo.srcwill download the latest source format terminfo file and install the tmux-direct and tmux-256color entries into the default terminfo database directory. Then
$ for term in tmux-256color tmux-direct ; do TERM=$term dotnet run ; donewill run the program under the different terminfo entries.
Expected behavior
I expect direct color mode terminal entries to behave like 256color entries (given the limitations).
Actual behavior
Tmux 3.1c in Konsole 20.04.2 produces something like
The respective konsole-* entries behave the same, in and out of tmux.
Regression?
No.
Known Workarounds
No response
Configuration
- .NET 6.0.100
- openSUSE Leap 15.3
- x64
- WSL2 exhibits same symptoms
Other information
- There are no test cases for direct color mode entries.
- The max color count record from
infocmpiscolors#0x1000000. - Looking at the color pattern it almost seems like some bytes are not being read out of the database.
- My
COLORTERMis1.0and unset do not affect this behaviour.

Activity