-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Integrated terminal (cygwin64 bash) not rendering color escape codes on php output #22616
Comments
Looks like |
@hazzlewis is there any trick to getting the cygwin exe running in the terminal? It's telling me |
You may have to re-run the setup installer and install the CHERE package. Not sure if needed but thats the only thing i can think of which i have installed which could make a difference off the top of my head.
Kind Regards
Harry Lewis
…-------- Original message --------
From: Daniel Imms <[email protected]>
Date: 14/03/2017 22:31 (GMT+00:00)
To: Microsoft/vscode <[email protected]>
Cc: Harry Lewis <[email protected]>, Mention <[email protected]>
Subject: Re: [Microsoft/vscode] Integrated terminal (cygwin64 bash) not rendering color escape codes on php output (#22616)
@hazzlewis<https://github.com/hazzlewis> is there any trick to getting the cygwin exe running in the terminal? It's telling me /usr/bin/bash wasn't found after a fresh install and using your settings?
-
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#22616 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ATSpMbDeg8AgYSIoHmw0T2vYcvGLdOUAks5rlxU6gaJpZM4McwqL>.
|
Interestingly, it works absolutely fine when executing the command on a VM. Apparently the issue is only occurring when executing it locally. Maybe it's something to do with Windows vs Linux. Local:
VM:
|
@hazzlewis a lot more stuff happens to get the terminal working on Windows so that's not surprising. Do you see the same problem if run through Git Bash? (install git and then add |
Ping @rprichard, potential issue with winpty (or the PHP cli?). |
winpty translates 'x1b' to '?', but that's expected (rprichard/winpty#47). It's probably an incorrect environment setting. I see that the issue reproduces if |
Do you need more info about my environment?
Kind Regards
Harry Lewis
…-------- Original message --------
From: Ryan Prichard <[email protected]>
Date: 22/03/2017 02:35 (GMT+00:00)
To: Microsoft/vscode <[email protected]>
Cc: Harry Lewis <[email protected]>, Mention <[email protected]>
Subject: Re: [Microsoft/vscode] Integrated terminal (cygwin64 bash) not rendering color escape codes on php output (#22616)
Looks like \x1b is being translated to ? somewhere along the way.
winpty translates 'x1b' to '?', but that's expected (rprichard/winpty#47<rprichard/winpty#47>).
It's probably an incorrect environment setting. I see that the issue reproduces if TERM is set to xterm. That shouldn't happen -- VSCode should leave TERM unset, then Cygwin bash.exe should set it to cygwin.
-
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#22616 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ATSpMSKMcKY4Y4VS_nrKbhFv2shG_sVKks5roIkNgaJpZM4McwqL>.
|
@hazzlewis Yes, I'm only able to reproduce the issue by manually setting |
Can you elaborate??
Kind Regards
Harry Lewis
…-------- Original message --------
From: Ryan Prichard <[email protected]>
Date: 22/03/2017 11:02 (GMT+00:00)
To: Microsoft/vscode <[email protected]>
Cc: Harry Lewis <[email protected]>, Mention <[email protected]>
Subject: Re: [Microsoft/vscode] Integrated terminal (cygwin64 bash) not rendering color escape codes on php output (#22616)
@hazzlewis<https://github.com/hazzlewis> Yes, I'm only able to reproduce the issue by manually setting TERM incorrectly, so I need more info. e.g. What is your TERM variable set to?
-
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#22616 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ATSpMYJwfgWWWcYmJozzRJxxfebAu99Mks5roP-agaJpZM4McwqL>.
|
@hazzlewis Do you have Here's what I see on Windows 7 64-bit in VSCode 1.10.2 with
(The Details: I created a new Laravel project with these steps:
It looks like the color support decision is made by
There are similar pieces of logic in:
For Windows, color escapes are enabled if |
@hazzlewis Here's another thing to try: instead of using VSCode, start your shell via
Then run
I'm still interested in whether your |
Using both git bash and cygwin it works absolutely fine in their own mintty consoles. Just doesnt work in vscode
Kind Regards
Harry Lewis
…-------- Original message --------
From: Ryan Prichard <[email protected]>
Date: 22/03/2017 22:46 (GMT+00:00)
To: Microsoft/vscode <[email protected]>
Cc: Harry Lewis <[email protected]>, Mention <[email protected]>
Subject: Re: [Microsoft/vscode] Integrated terminal (cygwin64 bash) not rendering color escape codes on php output (#22616)
@hazzlewis<https://github.com/hazzlewis> Here's another thing to try: instead of using VSCode, start your shell via Start -> Run:
C:\cygwin64\bin\bash.exe /bin/xhere /bin/bash
Then run php artisan as before. There are three outcomes I can think of:
* Broken (no color, visible escape sequences)
* Uncolored
* Colored
I'm still interested in whether your ANSICON and ConEmuANSI environment variables are set.
-
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#22616 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ATSpMcHIfjM6yLaTuofb8cWX_NyWjiG0ks5roaTBgaJpZM4McwqL>.
|
mintty isn't the Windows console -- it's a Cygwin-based VT/100 terminal emulator. I'm not surprised that it works fine in mintty. mintty will set The issue is why these same PHP-based components decide to write escapes to a Windows console, where they aren't interpreted. So, to reinterate:
It would also be interesting to know if you have the It would be interesting to know if you have ConEmu installed. |
Further to the above, both ANSICON and ConEmuANSI are unset. |
Ok so i just looked at that function you found. Sure enough, thats whats doing it. Looks like a bug which has since been fixed in that symfony component because in my environment (2.8.3), the line reads:
So, the statement is always evaluating true on the first condition because my build
So i guess my remaining questions are: |
You could try setting |
It looks like the PHP-based code needs to be fixed to stop using escapes on Win10 when they aren't supported. Ideally, though, something would turn on the Alternatively, some command-line programs notice that they're writing to a Windows console (rather than a Unix tty) and use "Some programs" includes all Cygwin programs, so if you're using Cygwin SSH into a Cygwin SSH server, that's why color works. The PHP-based code will print escapes, which will reach the SSH client, and finally the Cygwin DLL will interpret color escapes into calls to If you use WSL SSH (into anything), then WSL turns on There's work to do on this issue, but it's not much of a VSCode issue. |
BTW, this comment in libuv is relevant. I see code in libuv to enable |
Here are PHP-related bug reports w.r.t.
|
Using cygwin64 bash.exe as integrated terminal like so:
Standard color prompt works just fine:
However executing a PHP script, color escape codes are not interpreted properly, resulting in garbled output. Specifically, running Laravel's artisan command:
This same command works as expected in mintty:
Am i doing anything wrong or is this a bug?
The text was updated successfully, but these errors were encountered: