Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PowerShell commands run to completion even with a broken pipe to an external (native) program #8420

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

Note: The issue isn't specific to Unix, as originally stated - see #15329

... | Select-Object -First 1 stops the upstream command after receiving the 1st input object, but the same is not true when the sink is an external program:

Steps to reproduce

1..10 | Write-Output -ov result | head -n 1; $result.Count

Expected behavior

1
1

Actual behavior

1
10

That is, Write-Output unexpectedly ran to completion, even though head exited after receiving the first input line, making it pointless to send additional objects to the pipeline.

Environment data

PowerShell Core v6.2.0-preview.2 on macOS 10.14.1
PowerShell Core v6.2.0-preview.2 on Ubuntu 18.04.1 LTS
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.