vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.19k stars 3.51k forks source link

Help with 256 color support on Windows #1968

Closed LukeFlynn closed 4 years ago

LukeFlynn commented 7 years ago

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?

lijunle commented 7 years ago

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

sanguine8082 commented 7 years ago

Windows Command Prompt does not support 256 colors :cry:

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.

chiefjester commented 7 years ago

I thought they supported 24-bit already?

related links: https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/6509361-provides-support-for-ansi-colors-like-in-bash

https://blogs.msdn.microsoft.com/commandline/2016/09/22/24-bit-color-in-the-windows-console/

sanguine8082 commented 7 years ago

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

Xapphire13 commented 7 years ago

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

tdurand commented 6 years ago

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

chabou commented 6 years ago

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

chabou commented 6 years ago

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)

tdurand commented 6 years ago

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.

chabou commented 6 years ago

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

kaminooni commented 6 years ago

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

dougmaitelli commented 6 years ago

Even worse here:

image

Related? #2327

Macmee commented 6 years ago

any movement on this issue?

dougmaitelli commented 6 years ago

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.

skegel13 commented 6 years ago

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.

scottbilas commented 6 years ago

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

szmarczak commented 6 years ago

Any news?

florisvaneck commented 6 years ago

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.

albinekb commented 6 years ago

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

szmarczak commented 6 years ago

Hyper 2.0.0 stable:

image

Stanzilla commented 6 years ago

That's https://github.com/xtermjs/xterm.js/issues/484

Tyriar commented 6 years ago

@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: https://github.com/Microsoft/vscode/issues/45693

dvf commented 6 years ago

Has this been resolved?

Xapphire13 commented 6 years ago

@dvf, nope the issue is still repro

panda2134 commented 6 years ago

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

jasonxoc commented 6 years ago

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.

Josema commented 6 years ago

Any news?

monsterkodi commented 6 years ago

This is related news: https://github.com/Microsoft/console/issues/57 A lot of console problems will probably be solved this fall/winter.

Tyriar commented 6 years ago

More specifically for hyper: https://github.com/Microsoft/node-pty/issues/216

monsterkodi commented 6 years ago

Better 30 years late than never :-)

prinsss commented 6 years ago

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

screenshot

Tyriar commented 6 years ago

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

duemti commented 5 years ago

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

Tyriar commented 5 years ago

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.

duemti commented 5 years ago

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

JesseVelden commented 5 years ago

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.

RReverser commented 5 years ago

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 https://github.com/zeit/hyper/pull/3329, so I suppose the issue should be fixed?

auslander commented 5 years ago

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

szmarczak commented 5 years ago

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

image

duemti commented 5 years ago

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

image

szmarczak commented 5 years ago

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 :)

auslander commented 5 years ago

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.

Tyriar commented 5 years ago

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.

szmarczak commented 5 years ago

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

heamaral commented 5 years ago

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:

szmarczak commented 5 years ago

After I've updated my Windows it works as expected :tada:

image

MortezaRamezani commented 4 years ago

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