Open bbuehrle opened 4 years ago
I ran into this this morning as well. I've used the command dozens of times in the past on this machine however this is the first project I've started on the 5.0 line. I'm on a Windows 10 machine using Git for Window's Bash.
For me, prefixing the command with php
got it to start working again, although I'm having some weird ansi escape codes showing up and --no-ansi
isn't helping, but at least I can get back into interactive mode again.
php ./bin/console make:entity
This sounds like a possible bug. Is everyone that’s having this bun on Windows? Is anyone on a different operating system? And can you confirm that just running ./bin/console will have the error but php bin/console will not?
Thanks!
Both ways php bin/console make:entity
and ./bin/console make:entity
give the same error as @bbuehrle.
But when I try php bin/console make:entity User
to update it, it gives that
So I cannot update the given entity ... I ran it on Debian 10 + Php7.3 + SF4.4.1
When I revert https://github.com/symfony/console/commit/7bcdcdfe16ed232e6197ed25c11030372b56914f#diff-81b2d36b4ec79f521cf2d553522e2a5f I'm able to use the console as I normally do. Since posix_isatty
doesn't exist for Windows, there's no other call to setInteractive(false)
so it just works.
If there's any other debugging I can do, or more information to add, just let me know.
@weaverryan I'm on Windows 10 using Git for Windows as @cjhaas is. Prepending php
to the bin/console
command does allow me to use the command in interactive mode.
$ php bin/console make:entity
Class name of the entity to create or update (e.g. BraveChef):
> Test
T?[K?7?[30;47mest?[39;49m?8e?[K?7?[30;47mst?[39;49m?8s?[K?7?[30;47mt?[39;49m?8t?[K?7?8
Your entity already exists! So let's add some new fields!
?[32mNew property name (press ?[39m?[32m<return>?[39m?[32m to stop adding fields)?[39m:
>
?[37;42m ?[39;49m
?[37;42m Success! ?[39;49m
?[37;42m ?[39;49m
Next: When you're ready, create a migration with ?[33mmake:migration?[39m
It certainly isn't pretty, but seems to function. Adding a field works as intended.
Based on the information that @cjhaas provided:
When I revert symfony/console@7bcdcdf#diff-81b2d36b4ec79f521cf2d553522e2a5f I'm able to use the console as I normally do. Since
posix_isatty
doesn't exist for Windows, there's no other call tosetInteractive(false)
so it just works.
it seems the issue is not with symfony/maker-bundle, but with symfony/console. Should this issue be moved (or I can create a new one) to the main symfony/symfony repo?
I had the same issue under gitbash on windows 10. In the code below :
if ((!$inputStream || !stream_isatty($inputStream)) && false === getenv('SHELL_INTERACTIVE')) {
Looks like the streamisatty is always false on windows 10 on gitbash. A possible solution is to set SHELL_INTERACTIVE to whatever value you want to bypass the isatty check.
A possible fix would be to rewrite the condition and isolate the stream_isatty case.
Some simialar here. Windows 10, Symfony 5.0 and make:controller. Also prefixing with it php does the trick.
I created a new Symfony project using
composer create-project symfony/website-skeleton
which installed:- Installing symfony/maker-bundle (v1.14.3)
No other configuration or code was added to the project. When I run
bin/console make:entity
without any arguments, I usually am put into interactive mode where it asks for then entity name and field definitions. Now, I receive an error:https://github.com/symfony/maker-bundle/blob/443411aa3c75d87efb07a67f170295ff0961e257/src/Maker/MakeEntity.php#L133-L136
https://github.com/symfony/maker-bundle/blob/443411aa3c75d87efb07a67f170295ff0961e257/src/Generator.php#L127
This may be a separate issue, but when I run
make:entity
with any argument then the entity is generated with anid
field only and then drops out of the command.Environment: