Skip to content

print masks exit codes for external commands #19227

Closed

Description

@JustLinuxUser

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

in a pipeline, the errors should be counted as errors even if the command erroring is not the last in the pipeline.
With external commands and print, that does not seem to be the case

open /non_existant | print # an error, exit code 1
^cat /non_existant | print # No errors, exit code 0

If this worked properly, it would be very useful, as it would be the best way to redirect an external command's stdout to stderr, like so
^echo hello | print -e, but unfortunetelly, this masks errors

How to reproduce

open /non_existant | print # an error, exit code 1
^cat /non_existant | print # No errors, exit code 0

Expected behavior

I expect nu to trow an error

Configuration

key value
version 0.116.1
major 0
minor 116
patch 1
branch makepkg
commit_hash b632ef0
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.99.0 (b940084d7 2026-09-28) (Arch Linux rust 1:1.99.0-1)
cargo_version cargo 1.99.0 (5f94df478 2026-08-27) (Arch Linux rust 1:1.99.0-1)
build_time 2026-10-04 19:55:39 +00:00
build_rust_channel release
allocator standard
features dap, default, lsp, mcp, network, plugin, rustls-tls, sqlite, trash-support
installed_plugins
experimental_options example=false, dc-glob=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=true, native-clip=false, cell-path-types=false
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