From 0c921e4fddfc69e68531f372224e344e3892d27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sat, 15 Apr 2023 19:24:35 +0200 Subject: [PATCH] Do not print the CR --- src/message.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/message.rs b/src/message.rs index 922ee4c..4eac0b5 100644 --- a/src/message.rs +++ b/src/message.rs @@ -118,6 +118,11 @@ impl Message { } async fn print_line(&self, line: &[u8]) -> Result<()> { + let line = if line.ends_with(&[b'\r']) { + &line[..line.len() - 1] + } else { + line + }; let mut stdout = BufWriter::new(tokio::io::stdout()); stdout.write_all(RETURN_START).await?; stdout.write_all(self.session_id.as_bytes()).await?;