Skip to content

Process.start detachedWithStdio stdout is buffered when not desired #44573

@Sidewinder1138

Description

@Sidewinder1138

I'm trying to use Process.start on Windows to just launch an app (I'm making a CLI tool), and then output that app's stdout/stderr to terminal. It works, but I noticed that the stdout is being buffered, it outputs in "real-time" at first, but then halts, and only when I kill the launched process does it dump all the remaining output.

Here's what I'm doing:

Process.start(exePath, [],
        workingDirectory: workingDir,
        mode: ProcessStartMode.detachedWithStdio)
    .then((process) {
  process.stdout.pipe(stdout);
  process.stderr.pipe(stderr);
});

I've looked at #5607, but it was just closed as if this isn't a problem, which I'm pretty sure it is, at least on Windows.

I'm running from cmd.exe, inside Windows Terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-ioneeds-infoWe need additional information from the issue author (auto-closed after 14 days if no response)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions