Skip to content

exec_subshell() function should collect stderr as well as stdout #4224

Closed

Description

@krader1961

While working on the fix for issue #4211 I noticed that the exec_subshell() function only collects the stdout of the sub shell. This means that any output written to stderr by fish script run via that function is written to file descriptor 2 and cannot be redirected (e.g., to /dev/null) or otherwise processed by the code that calls exec_subshell(). This is broken. It's also an example of how the current fish design for managing file descriptors and stdin/stdout/stderr is problematic.

I'm going to work around this by documenting that argparse validation code write error messages to stdout rather than the more natural stderr. But having to do so is quite annoying.

Activity

  1. krader1961 commented on Jul 18, 2017

    @krader1961
    ContributorAuthor

    This problem also means that commands, such as test, run within the argparse argument validation context that write to stderr cannot be captured and redirected by the argparse implementation.

  2. anordal commented on Jul 18, 2017

    @anordal
    Contributor

    Is this the cause of #1035 ?

  3. krader1961 commented on Jul 18, 2017

    @krader1961
    ContributorAuthor

    Closing as dup of #1035.

  4. locked as resolved and limited conversation to collaborators on Apr 17, 2020
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions