-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[bug]: no progress helper output on windows #10011
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
Comments
Windows CAN support colors using ANSICON but you need to install and configure this manually, Git shell uses sh.exe wrapped with cmd.exe and so does node.js (somehow) but PHP uses CMD which does not support ANSI colors. Its also possible to use a better shell for Windows, but I have been unable to get that working. |
ok, but that doesn't change the fact that there's is no output from progress helper by default on current version. |
This is expected. If the output is not decorated, the display of the progress bar would be totally messed up, as it uses some ANSI control sequences to handle the overwriting. gitBash emulates colors only for git, by using a special build of Git. They don't apply their emulation for other processes running in the shell. Using the native APIs to set the console color cannot be done from PHP, as it is not controlled by the text stream itself but by some C API. Symfony uses the ANSI control sequences to display colors in the console output. If you want colors in your Windows console, I suggest you to use conEmu, which supports ANSI colors and is detected by Symfony to mark the output as decorated (or ANSICON as suggested by @sstok). My current setup is to run gitbash (because I prefer bash over the cmd for command line) inside conEmu (to support colors and other cool features of ConEmu) |
i think you totally miss the point. on 2.3 version i have output. on 2.4 i see nothing. this is clearly a regression. so i'm sticking to 2.3 for now |
hmm, it is true that Windows properly handle the overwriting sequence chars even without supporting the ANSI colors. |
The problem is the line that you pointed out. As far as I can read in #9511 checking if it was decorated was just a trick to not get problems when using a CI. But the problem is that it also breaks Windows. There should be another better way to check if the console is run in a CI or not. Already suggested were |
|
Ping, can someone come up with a solution for this? I also think that simply ignoring the complete output of the progress bar is not the best way of doing things. We can only just show something at the start and end of a progress. That way, we don't need to override characters. The current way (hiding it completely) made me bussy for 1 hour debugging why the bar wasn't shown. |
I have to say that the progress doesn't work in Mac OS X since 2.5. I had to revert to 2.4.*@dev. |
@wouterj I'm currently using EmuCon (http://code.google.com/p/conemu-maximus5/wiki/ConEmu) which was recommended by stof, and works perfect! |
Can you guys weigh in on #11852? |
…allow non-decorated output (kbond) This PR was merged into the 2.6-dev branch. Discussion ---------- [Console] add overwrite flag to ProgressBar helper to allow non-decorated output | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | yes, but not critical | Deprecations? | no | Tests pass? | yes | Fixed tickets | #11542, #10011 | License | MIT | Doc PR | symfony/symfony-docs#4206 By default, the `ProgressBar` helper overwrites the output to give the nice progress bar look. To prevent the output from blowing up in non-decorated environments, the output was hidden in these environments (see #9846). This PR enables using the `ProgressBar` in non-decorated environments by adding an `overwrite` flag. When `false`, instead of overwriting the bar, it is rendered on a new line. To prevent flooding the output, you can adjust the `redrawFrequency`. By default, when using the `ProgressBar` in a non-decorated environment, the `overwrite` flag is set to false. If a `max` is set, the `redrawFrequency` is set to a sensible default (10% of the max). If a `max` isn't set, the bar is output for every advance so to prevent flooding, a sensible `redrawFrequency` should be manually set. The only BC break is that output will now display where it didn't before. Commits ------- cdee6f6 add overwrite flag to allow non-decorated output
As this is a bug- can it be backported to 2.5? |
It's not a bug imo. It was disabled in windows by design. |
I was using it on 2.4 just fine. This is like saying 'we don't support mysql anymore by design'. I would highly appreciate if it could make its way into 2.5. |
It is instead, it doesn't work on Mac OS X either. On Oct 1, 2014, at 1:14 PM, Wouter J wrote:
|
Btw. when progressbar appears (e.g. with 2.6.*-dev), it should display a CRLF on |
on windows, git bash shell
progress helper has no output
the reason is on this line https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Helper/ProgressHelper.php#L191
ConsoleOutput says it's not decorated, so the output gets set to NullOutput
in 2.3 i get output, it's all white but it's there.
could the white output be returned to windows instead of none?
thanks
and git bash clearly supports colors as the username is green and folder is yellow. also node.js produces colored output.
The text was updated successfully, but these errors were encountered: