Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminfo direct color mode does not work #63645

Open
Tracked by #64487
commonquail opened this issue Jan 11, 2022 · 1 comment
Open
Tracked by #64487

Terminfo direct color mode does not work #63645

commonquail opened this issue Jan 11, 2022 · 1 comment

Comments

@commonquail
Copy link

commonquail commented Jan 11, 2022

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.
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Console untriaged New issue has not been triaged by the area owner labels Jan 11, 2022
@ghost
Copy link

ghost commented Jan 11, 2022

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

System.Console does not print colors correctly under terminal emulators using terminfo's direct color mode entries. I understand that there are several other cross platform issues with System.Console (#52374) but none of those directly identify an issue with (any kind of) support for 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.

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

Expected behavior

I expect direct color mode terminal entries to behave like 256color entries (given the limitations).

Actual behavior

$ for term in tmux-256color tmux-direct ; do TERM=$term dotnet run ; done

in tmux 3.1c in Konsole 20.04.2 produces something like

image

The s/tmux/konsole entries behave the same, in and out of tmux.

Regression?

No response

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. Looking at the color pattern it almost seems like some bytes are not being read out of the database.

Author: commonquail
Assignees: -
Labels:

area-System.Console, untriaged

Milestone: -

@jeffhandley jeffhandley added this to the Future milestone Aug 2, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants