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

Windows REPL resets text color to white after output instead of resetting to the previous foreground color (e.g. grey) #13425

Closed
dilijev opened this issue Jun 3, 2017 · 5 comments
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding. tty Issues and PRs related to the tty subsystem. windows Issues and PRs related to the Windows platform.

Comments

@dilijev
Copy link

dilijev commented Jun 3, 2017

  • Version: v8.0.0, v7.10.0, v7.9.0 (does not affect Boron v6.10.3)
  • Platform: Windows 10 x64 Build 10.0.15063
  • Subsystem: REPL

After the REPL displays some output to the console, it resets the text color to white instead of the previous foreground color.

Easiest to show with a picture comparing Boron (v6.10.3) to affected versions:

image

@addaleax addaleax added libuv Issues and PRs related to the libuv dependency or the uv binding. tty Issues and PRs related to the tty subsystem. windows Issues and PRs related to the Windows platform. labels Jun 3, 2017
@antishok
Copy link

antishok commented Jun 3, 2017

fwiw, it's not happening on windows 7 here (tested with both node 7.7.2 and 8.0.0)

@seishun
Copy link
Contributor

seishun commented Jun 3, 2017

Sometime between 6.10.3 and 7.10.0, Node.js upgraded to a libuv version that uses ANSI codes under Windows 10 (instead of emulating them using Windows-specific calls). That's why this issue doesn't affect Windows 7. See libuv/libuv#889.

The problem is that Windows 10 support for ANSI code seems to be incomplete. Here's the string that is printed when REPL outputs null:

'\u001b[1mnull\u001b[22m'

While "22" is listed in Wikipedia as "Normal color or intensity", it's not listed in MSDN.

Pinging @miniksa since you offered help with the libuv PR. Is my observation correct? Is it planned to add support for the '22' escape code in the future? If not, which escape code would you suggest using to revert boldness?

@miniksa
Copy link

miniksa commented Jun 5, 2017

I'm pretty sure my co-worker @zadjii-msft was looking at 22m on Friday for an unrelated reason. I'll let him fill in the details.

@zadjii-msft
Copy link

Yea this looks like this is just due to us missing that one code. I'll try and get to implementing it this week,
it doesn't seem all that complicated...

See here for more discussion, and links to other related conversations:
microsoft/WSL#2174

@bnoordhuis
Copy link
Member

Not a node.js bug then. I'll close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding. tty Issues and PRs related to the tty subsystem. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

8 participants