insanitybit / cargo-sandbox

MIT License
112 stars 2 forks source link

Malformed output for commands #1

Closed insanitybit closed 1 year ago

insanitybit commented 1 year ago

Output from docker commands is handled like so:

        let mut body = res.into_body();
        print!("\n");
        while let Some(chunk) = body.next().await {
            let chunk = chunk?;
            if chunk.is_empty() {
                continue;
            }
            print!("{}", String::from_utf8_lossy(&chunk));
        }

This is not working properly. Close though. Here's some output for cargo run -- check:

    Updating crates.io index
 Downloading crates ...
  Downloaded clap_lex v0.3.0
   Downloaded futures-io v0.3.25
  Downloaded futures v0.3.25
"  Downloaded futures-task v0.3.25
  Downloaded strsim v0.10.0
#  Downloaded serde_derive v1.0.147

Note the weird spacing and odd characters.

insanitybit commented 1 year ago

Like to do with the Stream Format: https://docs.docker.com/engine/api/v1.41/#tag/Container/operation/ContainerAttach

insanitybit commented 1 year ago

Fixed, though we're losing coloring of the output - I assume this would require some sort of shell configuration. I'll open a new issue around that.