Skip to content

Comments

fix: Decode shell v2 packets#172

Merged
cocool97 merged 3 commits intococool97:mainfrom
rib:rib/pr/shell-v2-decode
Feb 1, 2026
Merged

fix: Decode shell v2 packets#172
cocool97 merged 3 commits intococool97:mainfrom
rib:rib/pr/shell-v2-decode

Conversation

@rib
Copy link
Contributor

@rib rib commented Jan 13, 2026

When shell v2 is enabled then the shell output is sent in packets that allow stdout, stderr and the exit status to be in separate channels.

This updates the shell_command trait method so it can accept optionally separate stdout/stderr dyn Writes and return an optional u8 exit status.

If no stderr dyn Write is given then stdout + stderr will be merged into the single stdout dyn Write

Fixes: #171

When shell v2 is enabled then the shell output is sent in packets that
allow stdout, stderr and the exit status to be in separate channels.

This updates the shell_command trait method so it can accept optionally
separate stdout/stderr `dyn Write`s and return an optional u8 exit status.

If no stderr `dyn Write` is given then stdout + stderr will be merged
into the single stdout `dyn Write`

Fixes: cocool97#171
break;
}
output.write_all(&message.into_payload())?;
// should this just write for ::Write messages?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since I'm not familiar with when this message transport is used, I wasn't entirely that I was updating this correctly

@rib
Copy link
Contributor Author

rib commented Jan 19, 2026

Btw, thanks for taking a look over this PR. Your follow up changes all look good to me.

It would be great if you'd be able land this and make a release if possible.

I'm currently depending on this branch in order to write / run tests for a jni binding generator for Android and currently need to wait for a release before I can publish to crates.io

@cocool97
Copy link
Owner

I'll create a new breaking release soon, and this PR will be included.

I need to finish/merge the last waiting PR and it will follow :)

@cocool97 cocool97 merged commit a0b525f into cocool97:main Feb 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shell_command outputs raw shell v2 packets

2 participants