-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
VSCode Integrated terminal text color goes crazy after npm or gulp commands #40327
Comments
I have similar program.
Now, my text background color is red. |
Seems colors are just going crazy in the console. Using cmd or PoSH directly with the same commands doesn't cause these issues. |
Interesting but no. My text is perfect shape. It is just that the background and text colours seem to be random and in a lot of cases end up being black on black. |
@mattgoldspink that's a different issue, see #34320 |
This bug was/is making me crazy. Running npm start or ng server will override my powershell colors with another blue/yellow theme I cannot find. confusingbits suggestion on this post - #40190 fixes the issue for powershell on win 10 version Version 10.0.16299 Build 16299. But also downgrades my powershell to the legacy version... |
I know! after many updates and new versions, this bug isn't getting any better. |
Affecting me badly, i wanted to use integrated terminal to do |
After many VSCode releases, this issue still happens all the time. |
@shaipetel this is happening due to an obscure bug in winpty which will likely be very difficult to fix. My hope is the problem will just go away if we give new APIs from the Windows console team microsoft/terminal#57 |
@Tyriar thanks, is there something I can do on my end that will fix it? |
@shaipetel I think it's a wee bit of an exaggeration to say that the terminal "doesn't work and can't be used at all" 😉. But I agree it does make things difficult. :/ |
@robertmain when the background is black, and the text is black and I can’t even see what I type, nevertheless see what the console put out - you don’t consider this to be something I can’t use at all? Sorry, I don’t posses console-mind-reading capabilities... if I Can’t read any of the text in the console it’s pretty much useless to me... |
This looks like it might be related microsoft/WSL#2344?
On closer examination, it might not be. There might be something npm/gulp is emitting that we don't support yet. IIRC there were some background-color fixes in this most recent release cycle, is this still happening in the most recent Insider's flights? |
@shaipetel investigating upstream is the main thing that could help.
@zadjii-msft this is sometimes an issue but I've told several people to set the colors to normal and it still occurs so I think winpty might be interpreting what gulp/npm/something else does incorrectly (which I'm assuming uses chalk). |
@shaipetel I consider that to potentially be a different issue than the one described by OP. Or perhaps not, who knows. Your console mind reading abilities may not be up to much, but equally our mind reading abilities are also lacking. If your manifestation of the bug is slightly different to the OP it can be helpful to give some information rather than just sitting there and expecting someone to somehow use the force to sense what's on your screen. Just a thought. |
FYI my own experience with this issue (#45015) indicates that this is not due to anything that npm or gulp is doing specifically, other than 'reseting' the terminal colours back to default after decorating text in their output. The issue is with how the terminal window interprets that 'reset' - its default state is not the correct white-on-black one. If anyone wants to experiment to see if what affected me also affects you, just run |
@robertmain Hey Robert, I am the OP, look at the first picture. See the last "blank" line in the terminal of the first picture? its not blank. Its just that the terminal changed to black on black. I can still type there, it still runs commands, but from that point I am completely "blind". Sorry if that wasn't clear before, I hope now it makes it clearer and that you'd agree it is completely useless from that point. |
Heh. Didn't see your name as the OP. Either way, I can see text in the first picture(albeit slightly garbled text). The impression I got from your comment was that the console was completely and utterly blank. Like just a black rectangle with nothing in it. Hence why I thought it might be a different issue to the OP... |
Yeah, to make it clear: I can type the first command just fine. the output is all crazy-color. Once the first command finishes, I end up with a black on black terminal... |
Adding here in case it gives any additional info: I have similar (but slightly different) behavior when I run npm/yarn scripts inside VS Code terminals, but I also have problems with WSL Bash terminals generally: That's what it looks like if I just open a WSL Bash terminal inside VS Code. Note how the first line is fine up until the This is what it looks if I open WSL from the start menu: Other oddities:
I have this in my
|
The latest update to Windows 10 (The April 2018 update - 10.0.17134.48) resolved this issue for me. |
@tomjaimz oh really? Wasn't expecting that. If anyone else doesn't see the issue anymore right after updating I'd like to know 😄 |
I haven't used terminal in a long time, but after getting notification, I tried, it is indeed working. But along the way I did went to registry to delete any customization done on cmd and also installed cobalt2 theme. Not sure if any of those actions help fix the crazy colors |
This is likely related to winpty, tracking in #45693 |
Steps to Reproduce:
Reproduces without extensions: Yes
Running gulp on SPFx project changes the text to be black on black
Running npm outdated highlights the text like it is selected
There is no way to fix it after this happens except either type in blind or open a new terminal
The text was updated successfully, but these errors were encountered: