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

Is 256 color supported? #108

Open
Tyriar opened this issue Apr 21, 2017 · 5 comments
Open

Is 256 color supported? #108

Tyriar opened this issue Apr 21, 2017 · 5 comments
Labels

Comments

@Tyriar
Copy link

Tyriar commented Apr 21, 2017

Downstream issue: microsoft/vscode#24620

This was done through VS Code Insiders which runs [email protected]/[email protected].

Running the following through Cygwin/Git Bash:

echo -e '\x1b[48;5;100mfoo\x1b[0m'

Results in:

image

Here is what's being sent back from node-pty:

image

Expected (run under macOS/bash):

screen shot 2017-04-21 at 10 00 11 am

@rprichard
Copy link
Owner

It's definitely not supported currently. At the moment, I don't know how winpty could add support, because AFAIK there's no API to read 256-color info. winpty reads cell contents using ReadConsoleOutput, which returns each cell's contents in a CHAR_INFO struct, which has a 16-bit field for a Unicode codepoint and another 16-bit field for text attributes. The 16-bit attributes field uses 4 bits each for foreground and background color, then another 7 bits for LVB attributes.

@rprichard
Copy link
Owner

In principle, the winpty project could include a wrapper program like wslbridge (or ConEmu's Cygwin connector?) that creates a Cygwin/MSYS2/WSL pty, connects to the winpty agent over a TCP socket, then marshals VT/100 I/O directly to the winpty client without going through the console.

Pros:

  • Faster and quicker I/O, probably.
  • No line wrapping quirks
  • 256-color support
  • Full UTF-8 support

Cons:

  • It would only work for Cygwin/MSYS2/WSL programs
  • People have to know to run the "connector" program
  • The Cygwin/MSYS2 connectors would link against Cygwin's DLL, and I'm not sure the Cygwin DLL's ABI is stable. ConEmu is doing it, though, so maybe it's good enough.
  • More complexity. I'm not sure how motivated I am to implement it.

@rprichard
Copy link
Owner

Regarding the output passthrough, this other winpty request was related: #89.

@bgshacklett
Copy link

Has there been any further discussion behind the scenes on this issue? Microsoft recently opened up a Console repository where issues may be opened for conhost.exe and the console API. Perhaps opening an issue here might help get things moving again (if they're not already).

https://github.com/microsoft/console

@zzecool
Copy link

zzecool commented Apr 25, 2024

Is anyone on this bug ?

This creates all shorts of color problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants