You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Piping an external command to ignore should not swallow its exit code #17849
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
@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.
@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).
Activity
fdncred commentedon Mar 21, 2026
so, you really don't mean
ignorein this case.ItsHarper commentedon Mar 22, 2026
I mean "ignore the output", not "ignore errors"
fdncred commentedon Mar 22, 2026
That's probably another command or maybe a flag. Or maybe pipe to
null?Mrfiregem commentedon Mar 23, 2026
You can do
^false o+e> /dev/nullEndlessLucky commentedon Mar 25, 2026
@ItsHarper Can I work on this issue?
fdncred commentedon Mar 25, 2026
@EndlessLucky I don't see any other rust code you've worked on.
EndlessLucky commentedon Mar 26, 2026
@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.
fdncred commentedon Mar 26, 2026
What is your plan then?
EndlessLucky commentedon Mar 26, 2026
@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).
fdncred commentedon Mar 26, 2026
i don't really agree. non-zero doesn't mean error all the time. https://www.sophiajt.com/exit-codes/
Juhan280 commentedon Apr 14, 2026
IMO,
ignoreswallowing the exit code IS the intended behavior.ItsHarper commentedon May 4, 2026
Do you think it's desirable to swallow external exit codes, but not errors from nushell commands?
fdncred commentedon May 29, 2026
This is the best I could come up with #18306