Skip to content

Terminfo direct color mode does not work #63645

Open

Description

@commonquail

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

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.src

will 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 ; done

will 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

image

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 infocmp is colors#0x1000000.
  • Looking at the color pattern it almost seems like some bytes are not being read out of the database.
  • My COLORTERM is 1. 0 and unset do not affect this behaviour.

Activity

  1. ghost added
    untriaged
    on Jan 11, 2022
  2. added this to the Future milestone on Aug 2, 2022
  3. ghost removed
    untriaged
    on Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions