-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Unable to output to debug console when script is executed in terminal #958
Comments
Please see first my response to your earlier issue #957 (comment) Again first - what is the reason you want to run the script in a terminal and not via There is a way to redirect/duplicate STDOUT to the debugger, but that is currently not exposed to user configuration. |
The reason to launch the script in a terminal is to be able to pass arguments easily without having to edit the How would one redirect/duplicate SDOUT to the debugger while outputting to the terminal? However I also noticed that by running a script in the terminal without using the debugger, I get this error every time before it executes the script. Not sure if there is a way to remove this error without disabling the debugging settings in the php.ini.
|
I fiddle around with the php.ini and VSCode debug launcher configuration and made some changes for my setup that is more to my liking, It solves the error message I get every time I run a script without using the debugger php.ini additions (I only added this one setting, nothing else)
VSCode debug launcher configurations
The PHP: Console will run the currently opened script in the debug console and all outputs will be in the debug console. The PHP: Terminal will run the debugger, wait for the user to run the script which will require the script to be launch with the following runtime argument If possible I would like to find a way to not need to add the runtime argument to the terminal executable command to run the script and somehow have the And if possible to have the output always be shown in the debug console, even when running the script in the terminal. |
PHP version: 8.1.2
Xdebug version: 8.1.2
VS Code extension version: 1.34.0
Your launch.json:
Xdebug php.ini config:
These are the added lines to the php.ini for xdebug
Code snippet to reproduce:
When I use the PHP: Terminal debug launch config, and then run the script in the terminal, the script only outputs to the terminal and does not output anything to the debug console in VSCode. When you use the PHP: Console debug launch config on the opened script in VSCode, it will show the output in the debug console as expected.
Is it possible to have it output in both the terminal and the debug console? This is possible with NodeJS when debugging is VSCode to have it output in both the debug console and the terminal.
The text was updated successfully, but these errors were encountered: