fix(cli): write exec stderr events to stderr in interactive mode#2407
Closed
andrewwhitecdw wants to merge 1 commit into
Closed
fix(cli): write exec stderr events to stderr in interactive mode#2407andrewwhitecdw wants to merge 1 commit into
andrewwhitecdw wants to merge 1 commit into
Conversation
The Stderr arm of the interactive exec event loop was a copy of the Stdout arm and locked stdout, so stderr payloads were written to stdout. The non-interactive exec path already handles the same event with stderr. Write stderr payloads to stderr so shell redirection (e.g. 'openshell exec ... 2>err.txt') works in interactive mode. Signed-off-by: Andrew White <andrewh@cdw.com>
andrewwhitecdw
requested review from
a team,
derekwaynecarr,
maxamillion and
mrunalp
as code owners
July 22, 2026 04:07
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
|
Thank you for your interest in contributing to OpenShell, @andrewwhitecdw. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In interactive
openshell exec, stderr payloads from the sandbox were written to stdout because theStderrarm of the event loop was a verbatim copy of theStdoutarm (stdout.lock()). The non-interactive exec path in the same file handles the identical event withstderr.lock(). This broke shell redirection (e.g.openshell exec ... 2>err.txt) and piping of stdout in interactive mode.Related Issue
N/A — small copy-paste fix found during code review.
Changes
stderrin the interactive exec event loop and lock it in theStderrarm, matching the non-interactive pathTesting
mise run pre-commitpasses (mise unavailable in this environment; ran equivalentcargo fmt+cargo clippy -p openshell-cli --all-targets— clean)Checklist