Skip to content

Cannot stream both standardOutput and standardError simultaneously with closure-based run #41

Closed
@marlimox

Description

@marlimox

Describe the bug
If you try to stream both standardOutput and standardError from the Execution in the closure-based run method, it fails with Fatal error: The standard output has already been consumed.

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to access execution.standardOutput and execution.standardError in the same run closure.

Expected behavior
It should be possible to access both sequenced outputs.

Environment (please complete the following information):

  • OS: macOS 15.4.1 (24E263)
  • Swift version: swiftlang-6.1.0.110.21 clang-1700.0.13.3

Additional context
This looks like a simple copy/paste bug in Execution.swift, the consumption state is checking for .standardOutputConsumed rather than . standardErrorConsumed for the standardError case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions