Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make stderr works for failed external command #11914

Merged
merged 1 commit into from Feb 21, 2024

Conversation

WindSoilder
Copy link
Collaborator

Description

Fixes: #11913

When running external command, nushell shouldn't consumes stderr messages, if user want to redirect stderr.

User-Facing Changes

NaN

Tests + Formatting

Done

After Submitting

NaN

@WindSoilder WindSoilder added the pr:bugfix This PR fixes some bug label Feb 21, 2024
Copy link
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for thoroughly working through all those redirection details

Playground::setup("redirection stderr with failed program", |dirs, _| {
let out = nu!(
cwd: dirs.test(),
r#"$env.FOO = "bar"; nu --testbin echo_env_stderr_fail FOO e> file.txt; echo 3"#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was confused at first why FOO was passed bare but then I read the echo_ENV_stderr_fail 😆

@WindSoilder WindSoilder merged commit 1058707 into nushell:main Feb 21, 2024
19 checks passed
@hustcer hustcer added this to the v0.91.0 milestone Feb 22, 2024
@WindSoilder WindSoilder deleted the stderr_handle branch February 27, 2024 05:49
kik4444 pushed a commit to kik4444/nushell-fork that referenced this pull request Feb 28, 2024
# Description
Fixes: nushell#11913

When running external command, nushell shouldn't consumes stderr
messages, if user want to redirect stderr.

# User-Facing Changes
NaN

# Tests + Formatting
Done

# After Submitting
NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix This PR fixes some bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirection: e>| and e> doesn't work properly if external command runs failed
3 participants