Skip to content

Standard out/ printf not flushed #24

@squix78

Description

@squix78

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions