platform-native icon indicating copy to clipboard operation
platform-native copied to clipboard

Standard out/ printf not flushed

Open squix78 opened this issue 1 year ago • 1 comments

Problem

On Mac OS X/ Ventura the output of printf will only be displayed after the native application has finished.

How to reproduce

Run the following example by running the upload target:

#include <stdio.h>

int main()
{
    printf("Hello World from PlatformIO!\n");
    for (int i = 0; i < 255; i++) {
        printf("I: %d", i);
    }
    while (1) {
        // endless loop
    }
    return 0;
}

Expected: while the program runs there is output on the console Actual: there is no output of the printf statements

When I run the compiled program directly I get the desired output, so in conclusion the pio run -t exec target must swallow the console output

squix78 avatar May 31 '23 06:05 squix78

did you find a solution to this? I'm also trying to find a way to change the console/tty behavior of -t exec like you can do with the monitor settings.

proddy avatar Aug 06 '24 11:08 proddy