Skip to content

Support for combined stdout and stderr output #3496

Closed

Description

@sipsma

There's many times you want to get both the stdout and stderr. It's slightly tedious to do this with the Go SDK since you have to grab them both separately (and check err, etc.). Maybe there could just be a field Output that grabs both for you at the same time?

Activity

  1. added this to the 0.3.0 milestone on Oct 24, 2022
  2. sipsma commented on Oct 26, 2022

    @sipsma
    ContributorAuthor

    To be clear, the first part of this issue is deciding if we actually want it. If so, the implementation should be straightforward I think.

  3. helderco commented on Oct 27, 2022

    @helderco
    Contributor

    Yes I think this makes a lot of sense. Problem is, you still need to specify the fields, no?

    container {
      from(...) {
        exec(...) {
            output {
                stdout
                stderr
            }
        }
      }
    }

    So it still makes two queries:

    cmd := ....Exec().Output()
    stdout, err := cmd.Stdout(ctx)
    stderr, err := cmd.Stderr(ctx)

    What can make this better is being able to select sibling fields in the same query since you'd execute only once. This ties into the explicit execution feedback.

  4. vito commented on Oct 28, 2022

    @vito
    Contributor

    @helderco The problem with fetching separate fields is you lose the interleaving, i.e. what a human would actually see if they ran the command themselves. I think that's the root ask of this issue.

    Implementation wise this might be a little tricky since we currently direct stdout/stderr to separate files. We could have the shim duplex to both separate streams and a combined one, it'll just add a bit of overhead. Probably not a huge deal.

  5. helderco commented on Oct 28, 2022

    @helderco
    Contributor

    I see, so you mean having 3 fields:

    container {
      from(...) {
        exec(...) {
            stdout
            stderr
            output  # string with combined stdout + stderr
        }
      }
    }
  6. added
    area/engine
    and removed on Dec 5, 2022
  7. removed this from the 0.3.0 milestone on Mar 15, 2023
  8. added 3 commits that reference this issue on Aug 22, 2025
    726a34f
    8472abd
    55e9c4a
  9. added a commit that references this issue on Aug 22, 2025
    3dfb4ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions