vercel/hyper

Help with 256 color support on Windows

Closed this issue ยท 47 comments

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate
  • OS 10.0.15063 and Windows:
  • Hyper.app 1.3.3:
  • Link of my .hyper.js
  • The issue is reproducible in vanilla Hyper.app:

Issue

Hi,

I would like to be able to use full 256color in Hyper. Setting the env variable TERM to xterm-256color displays colors perfectly.. but it breaks the functionality of the "clear" command. Is there some other way I can accomplish displaying the colors properly while retaining functionality of clear?

Another issue with TERM=xterm-256color, the vim will mess the screen content with the editing content.

Windows Command Prompt does not support 256 colors ๐Ÿ˜ข

You will need to use a different terminal, like Git For Windows or Msys2 to get 256 color support, and then point hyper.js to their respective executable.

I think Windows 10 might have support, but not before that.

Windows 10 does support 256 colors as of TH2, see here

When running AnsiColors256.ans via type AnsiColors256.ans in PowerShell I get:

image

But running the same command in Hyper I get:
image

Same issue here, is a fix underway ?

I have issue with this git config for diffs

[color "diff-highlight"]
        oldNormal = red bold
        oldHighlight = red bold 52
        newNormal = green bold
        newHighlight = green bold 22

terminaldiff

@tdurand can you confirm me that you are on Windows?

Using GitBash with Hyper (2.0.0-canary.10), this is what I get when running AnsiColors256.ans :
image

And WTF, my mouse pointer goes UNDER the grey zones... ๐Ÿ˜ฑ

(It works well on macOS)

Yes, i'm on Windows 10 using WSL with Ubuntu. And the color works well if you use the powershell terminal, so I'm pretty sure it's an issue of hyper.

Yes, an issue with Hyper (but only on Windows, from my testing).

I ran into the same problem. And since I use vim (with a lot of color schemes) for coding, it makes hyper almost unusable ๐Ÿ˜ž

shot

Even worse here:

image

Related? #2327

any movement on this issue?

I did a lot and research, testing. It seems it is not a Hyper issue. It is a node-pty issue because of a limitation in the way they interact with processes on Windows. So basically it seems to be still a Windows limitation.

You can even confirm this because the integrated shell in vs code has exactly the same issue, and they even use winpty instead of node-pty.

I am guessing as well it's not necessarily a Hyper issue since it occurs in VSCode as well as ConEmu. I am wondering though how Git Bash by itself or PuTTY does it. I can open Vim locally or when I ssh into a server with no issues. If I run Git Bash in Hyper though, I get the color issues.

ConEmu supports 256 and true color. Needs a bit of config.

https://conemu.github.io/en/Xterm256Colors.html

It works via a hook dll that monitors direct calls to write to the console, processing escape codes etc. There's also quite a lot of special case code, including detection of the vim process and powershell.

https://github.com/Maximus5/ConEmu/blob/master/src/ConEmuHk/hkConsoleOutput.cpp

Any news?

I would appreciate an update on this! Really harming my otherwise fantastic Hyper experience on Windows! Not seeing this issue in Hyper on Ubuntu (VMware).

I am using the hyper-solarized-dark-highcontrast theme to make it slightly less worse.

This is a windows issue @florisvaneck, not much we can do.

Hyper 2.0.0 stable:

image

@Stanzilla this is not actually xtermjs/xterm.js#484, that's for truecolor (16 million) color support. 256 color support in Windows is due to winpty: microsoft/vscode#45693

dvf commented

Has this been resolved?

@dvf, nope the issue is still repro

repro again on windows 10 build 1803 with hyper 2.1.0-canary2

Ohh I should have searched for this issue before taking the time to make this:
hyperjs-colors_messed_up

Man, windows terminal emulation sucks SOOO bad. Nothing but issues with drawing, color support, mouse support with tmux and vim. ... Hoping I can finally get gnome-terminal to work at some point.

Any news?

This is related news: microsoft/terminal#57
A lot of console problems will probably be solved this fall/winter.

More specifically for hyper: microsoft/node-pty#216

Better 30 years late than never :-)

Same issue here, Hyper 2.0.0 on Windows 10 1803. Any news?

screenshot

@printempw I'm working on microsoft/node-pty#216 which is expected to fix this, ETA is still a while off though.

Pardon me, but why SSH to virtual machine also doesn't display colors?
I don't think it's WSL specific bug. Heck, it even in windows environment doesn't print colors right.

untitled

Here Hyperterm at the left and GitBash at the right.
untitled2

This can be marked as fixed when Hyper adopts node-pty@0.8.0 https://github.com/Microsoft/node-pty/releases/tag/0.8.0. To be clear, it will not work for < Windows 10 1809 and non-WSL may or may not work.

Thank you very much for hinting.
Updated windows and on Terminus terminal it show all 256 colors.
For those wondering, install it with npm:
npm i terminus-terminal

Thank you very much for hinting.
Updated windows and on Terminus terminal it show all 256 colors.
For those wondering, install it with npm:
npm i terminus-terminal

That's not a solution for hyper though. Anyway thanks for pointing out a nice alternative.

This can be marked as fixed when Hyper adopts node-pty@0.8.0 https://github.com/Microsoft/node-pty/releases/tag/0.8.0.

This was now done in #3329, so I suppose the issue should be fixed?

Updated to Hyper 3.0.0 Canary 6 and still having the issue. Been fighting this off and on for months and just found this thread today. Thought I was just doing something wrong.
cat AnsiColors256.ans

Yup, still doesn't work. Latest Windows 10 and canary 6:

image

Actually it works. Probably you need to update your Windows 10 to build 1809 or higher.

image

Probably you need to update your Windows 10 to build 1809 or higher.

I'll give it a try. I've been putting off some updates for a few days due to some important work. I'll inform you later, thanks :)

Thanks for the update. Going through now and attempting to apply the 1809 update manually using the tool at microsoft.com. I had assumed windows update was automatically pushing the October update by this point but was mistaken. Trying now.

FYI there are several issues in Windows 1809 and I moved the default minimum version in node-pty to what is the current fast ring Windows Insiders build, so you should get this in windows 1903.

So we have to wait a lil bit more...

I've updated my windows to test it, and it works.
But clear isn't cleaning the buffer:

and caret doesn't hide when interacting with some interactive application:

After I've updated my Windows it works as expected ๐ŸŽ‰

image

It still doesn't work with msys2 on the latest version, mintty with msys2 works fine.