GNOME Bugzilla – Bug 127980
New flag for gspawn_async_with_pipes: G_SPAWN_STDERR_TO_STDOUT
Last modified: 2018-05-24 10:30:58 UTC
It would be nice to be able to call g_spawn_async_with_pipes and get stdout+stderr in the same file descriptor (which is dup2'ed in the child). So there could be a new G_SPAWN_STDERR_TO_STDOUT flag which would make something analog to $ command 2>&1 Thanks.
I think this would be useful too, since I could've used it in an app I wrote (I wound up using a child_setup function to do it). I'd be willing to do the unix implementation, how doable is this on windows?
Yes, doable on Windows. Would not add much complexity to the implementation (which already has to use a helper program to take care of some of the non- Unixness).
Yosh, do you have a patch for this ?
Not yet, but I can cook one up in a couple of days.
We now have this as G_SUBPROCESS_FLAGS_STDERR_MERGE. Might be nice to get it in gspawn too, then we could simplify the implementation in GSubprocess.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/17.