feat(shell) raw-encoded pipe reader directly outputs buffer (no newline scan) (#1231)

* Shell raw-encoded pipe reader directly outputs buffer (no newline scan)

* Suggestions from code review and add .changes file

* fmt
This commit is contained in:
Graham Held
2024-05-02 06:00:03 -07:00
committed by GitHub
parent aea748ced7
commit b4efa58d5d
3 changed files with 99 additions and 34 deletions
+4 -1
View File
@@ -154,7 +154,10 @@ pub fn execute<R: Runtime>(
let encoding = match options.encoding {
Option::None => EncodingWrapper::Text(None),
Some(encoding) => match encoding.as_str() {
"raw" => EncodingWrapper::Raw,
"raw" => {
command = command.set_raw_out(true);
EncodingWrapper::Raw
}
_ => {
if let Some(text_encoding) = Encoding::for_label(encoding.as_bytes()) {
EncodingWrapper::Text(Some(text_encoding))