Closed chx closed 3 years ago
Is it only drush php
? All other commands are working? drush cr
? Your environment is what exactly? OS? Psyshell version? PHP version? OS version? In what directory are you executing the command?
Yes, everything is working. Even drush php
itself is working it's just the readline / prompt functionality that's broken. Some terminal issues. I am using the Windows Terminal. I checked and $_SERVER['TERM'] is the same for both launcher and vendor/bin/drush, xterm-256color
. It'll be something else... but since Psy\Info() is not working, I have a bit of a hard time figuring out what.
I found the launcher adds --ansi
to the command but if I manually add it , that doesn't break. I am available for videocalls :)
I checked and it finds the drush version in vendor and the backtraces are fundamentally the same. However, $_SERVER is vastly different. While capturing with drush php |tee launcher-drush.txt
and vendor/bin/drush php |tee vendor-drush.txt
I found I can repro the behavior with the latter command!!
I am reaching the end of my Linux TTY knowledge :/
I am closing this as this is not the launcher's fault. I can repro with psysh|tee
.
Re-closing this and moving on to xdebug-handler.
Ha! xdebug-handler already fixed this so this will be solved by https://github.com/drush-ops/drush-launcher/issues/91
I am closing this as this is not the launcher's fault. I can repro with
psysh|tee
.
FWIW this (and the broken xdebug-handler forwarding) is happening because newer versions of PsySH detect when STDIN is not a TTY or when STDOUT is redirected, and act differently.
In the case of xdebug-handler, properly forwarding input and output fixes it. In the case of piping to tee
, you'd probably have to override the automatic detection and explicitly set input/output options on PsySH.
When launching via the launcher phar, Psy has no prompt and the arrows are broken:
and @webflo says DRUSH_ALLOW_XDEBUG=1 drush php works and it does so there's something about re-bootstrapping without xdebug here.