Skip to content

Need better way to work with native exes that report progress on stderr #3132

Closed

Description

Steps to reproduce

Today if you use an executable like git.exe (which uses stderr for progress not just errors), in the PowerShell console stderr appears like stdout (no ErrorRecords). In ISE, stderr is converted to ErrorRecords and displays in red. RE git.exe using stderr to report progress see http://git.661346.n2.nabble.com/git-push-output-goes-into-stderr-td6758028.html

This leads to less than a desirable user experience in ISE:

image

The above looks like an error but it is just git reporting progress i.e. that it switched to the branch.

Expected behavior

I would like a way to configure an app like git.exe to behave in a host that handles stderr like ISE does, to instead behave like the console. So the same command looks like this:

image

Also, it might be useful if a script or module had a way to query the host (or settings for a particular exe) to determine how its stderr is being handled.

Actual behavior

The progress output sent to stderr by Git is displayed as an error when it is NOT an error. I have a feeling this may be even more common in the Linux world so it would be good to have a more flexible "stderr handling" strategy than the current one.

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Activity

  1. joeyaiello commented on Feb 11, 2017

    @joeyaiello
    Contributor

    Oh, interesting. So like a PowerShell variable that lets you either redirect stderr into the PowerShell Error stream or not.

    Something like $PSRedirectErrors = $True or the negative $PSPassthruError = $True?

  2. lzybkr commented on Feb 11, 2017

    @lzybkr
    Contributor

    Untested and needs verification - but I believe #2450 should address hosts like the ISE and remoting that do not handle stderr like the console host. Maybe sergei (@vors) can chime in to confirm.

    Of course, that means these changes need to be pulled back into Windows for the ISE to pick it up.

  3. vors commented on Feb 11, 2017

    @vors
    Collaborator

    Jason is correct, but it's a different PR: #1599

  4. vors commented on Feb 11, 2017

    @vors
    Collaborator

    Duplicate of #1465

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