diff --git a/ptyd/src/pty.rs b/ptyd/src/pty.rs index 80cd2957a4..f68eb72f91 100644 --- a/ptyd/src/pty.rs +++ b/ptyd/src/pty.rs @@ -246,6 +246,19 @@ impl Pty { } self.update(); + if !buf.is_empty() { + let cc = self.termios.c_cc; + eprintln!( + "ptyd-diag: input {} bytes icanon={} echo={} vmin={} vtime={} -> cooked={} mosi={}", + buf.len(), + icanon, + echo, + cc[VMIN], + cc[VTIME], + self.cooked.len(), + self.mosi.len(), + ); + } } pub fn output(&mut self, buf: &[u8]) { diff --git a/ptyd/src/subterm.rs b/ptyd/src/subterm.rs index beda848fa3..f17e4a8565 100644 --- a/ptyd/src/subterm.rs +++ b/ptyd/src/subterm.rs @@ -51,6 +51,14 @@ impl Resource for PtySubTerm { pty.update(); + if !pty.mosi.is_empty() { + eprintln!( + "ptyd-diag: subterm read: mosi has {} packet(s), first len {}", + pty.mosi.len(), + pty.mosi.front().map(|p| p.len()).unwrap_or(0), + ); + } + if let Some(packet) = pty.mosi.pop_front() { let mut i = 0;