raix / vscode-perl-debug

LOOKING FOR MAINTAINERS. Perl debugger extension for visual studio code
MIT License
63 stars 35 forks source link

Print statements don't show up until program terminated #150

Open ishaan-mehta opened 4 years ago

ishaan-mehta commented 4 years ago

I am running the following simple test script:

use strict;
use warnings;
use Cwd;

print "Hello, world!";
print getcwd;

But I only am able to see the print statements' output after the program has terminated and the debugging session is over. The "result" section of the debug console shows nothing after executing n (next).

Here is the output I get in the debuggee terminal, where the script's output shows up only after the debug console says the debugging session has been terminated (after I step through the entire script): image

For more information, I am on Windows 10, running Strawberry Perl 5.30.1.

Is this a bug or is this an issue on my end?

Thanks!

dseynhae commented 4 years ago

You can solve this by turning on autoflush:

BEGIN{ $| = 1; }

It would be nice if the debugger just did this by default, but it isn't really a bug...