Replies: 1 comment 1 reply
-
|
What are you trying to achieve? What are you debugging? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
While developing locally (using Laravel v12.22.1), I needed to debug a controller action, so I added
eval(\Psy\sh());in the relevant place in the code. In the logs (either runningcomposer run devorphp artisan serve), I see some output from Psy shell, but it looks like execution doesn't stop.Digging a bit deeper, I saw that running directly
php -S localhost:8000 -t publicproperly stops. Checking the command ran by artisan (invendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php) I see that the command starts a new process and that process does not set TTY to true. Quickly adding a$process->setTty(true)in thestartProcessmethod of the command, everything works properly withphp artisan serve(still not working withcomposer run dev-I guess because npx concurrently creates a non TTY process on top of the other processes- with an error "TTY mode requires /dev/tty to be read/writable." - this is fixable by guarding before setting the value withisTtySupported)Is not setting TTY to true for the process on purpose? (eg because of side effects that I'm missing)? Would it make sense to have the
servecommand have tty be configurable?Otherwise I guess the main options for debugging controller actions would be setting up Xdebug or using
ddto inspect (or stoppingphp artisan serveand starting the server withphp -S ....directly)?Beta Was this translation helpful? Give feedback.
All reactions