Skip to content

Piping an external command to ignore should not swallow its exit code #17849

Closed

Description

@ItsHarper

Bug report form

  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.

Describe the bug

When you run an external command and pipe its output to ignore (because you don't care about its stdout output), if the command fails (returning a non-zero exit code), the error gets entirely swallowed.

How to reproduce

Run this on a unixy system

^false | ignore

Expected behavior

nonzero exit codes should still result in an error being thrown when the command output is piped to ignore

Configuration

key value
version 0.111.0
major 0
minor 111
patch 0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-chimera-linux-musl
rust_version rustc 1.94.0 (4a4ef493e 2026-03-02) (Chimera Linux)
cargo_version cargo 1.94.0
build_time 2026-03-18 20:42:24 +00:00
build_rust_channel release
allocator standard
features native-tls, network, plugin, sqlite, trash-support
installed_plugins formats 0.111.0, gstat 0.111.0, inc 0.111.0, polars 0.111.0, query 0.111.0
experimental_options example=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=false, native-clip=false

Activity

  1. added
    status:needs-triage
    on Mar 21, 2026
  2. fdncred commented on Mar 21, 2026

    @fdncred
    Contributor

    so, you really don't mean ignore in this case.

  3. ItsHarper commented on Mar 22, 2026

    @ItsHarper
    ContributorAuthor

    I mean "ignore the output", not "ignore errors"

  4. fdncred commented on Mar 22, 2026

    @fdncred
    Contributor

    That's probably another command or maybe a flag. Or maybe pipe to null?

  5. Mrfiregem commented on Mar 23, 2026

    @Mrfiregem
    Contributor

    You can do ^false o+e> /dev/null

  6. EndlessLucky commented on Mar 25, 2026

    @EndlessLucky

    @ItsHarper Can I work on this issue?

  7. fdncred commented on Mar 25, 2026

    @fdncred
    Contributor

    @EndlessLucky I don't see any other rust code you've worked on.

  8. EndlessLucky commented on Mar 26, 2026

    @EndlessLucky

    @fdncred I have been working on smart contracts of serveral blockchain networks such as Ethereum, Solana and Flow since 2021 and I built smart contracts using Solidity, Rust and Cadence. Most of repos are private so you cannot see on your side.

  9. fdncred commented on Mar 26, 2026

    @fdncred
    Contributor

    What is your plan then?

  10. EndlessLucky commented on Mar 26, 2026

    @EndlessLucky

    @fdncred I’ll update ignore so that it preserves and checks the exit status of upstream external commands instead of discarding it—if a non-zero exit code is detected, it should return an error rather than silently succeeding.
    I’ll also add tests to ensure failures still propagate correctly through pipelines (especially with pipefail enabled).

  11. fdncred commented on Mar 26, 2026

    @fdncred
    Contributor
  12. Juhan280 commented on Apr 14, 2026

    @Juhan280
    Contributor

    IMO, ignore swallowing the exit code IS the intended behavior.

  13. ItsHarper commented on May 4, 2026

    @ItsHarper
    ContributorAuthor

    Do you think it's desirable to swallow external exit codes, but not errors from nushell commands?

  14. fdncred commented on May 29, 2026

    @fdncred
    Contributor

    This is the best I could come up with #18306

  15. added this to the v0.114.0 milestone on Jun 2, 2026
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

    status:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions