diff --git a/markbase-core/src/ssh_server/channel.rs b/markbase-core/src/ssh_server/channel.rs index 00f89d0..62258ff 100644 --- a/markbase-core/src/ssh_server/channel.rs +++ b/markbase-core/src/ssh_server/channel.rs @@ -279,20 +279,21 @@ impl ChannelManager { fn handle_pty_request(&mut self, cursor: &mut std::io::Cursor<&[u8]>, channel: u32, want_reply: bool) -> Result> { info!("Handling pty request for channel {}", channel); - // 读取terminal类型 + // 读取terminal类型(SSH string) let term = read_ssh_string(cursor)?; - // 读取窗口大小 +// 读取窗口大小(4个uint32) let width = cursor.read_u32::()?; let height = cursor.read_u32::()?; - let pixel_width = cursor.read_u32::()?; - let pixel_height = cursor.read_u32::()?; + let _pixel_width = cursor.read_u32::()?; + let _pixel_height = cursor.read_u32::()?; - // 读取terminal modes + // 读取terminal modes(SSH string格式) let modes_len = cursor.read_u32::()?; - let modes = read_ssh_string(cursor)?; + let mut modes = vec![0u8; modes_len as usize]; + cursor.read_exact(&mut modes)?; - info!("PTY: term={}, width={}, height={}", term, width, height); + info!("PTY: term={}, width={}, height={}, modes_len={}", term, width, height, modes_len); if want_reply { Ok(Some(self.build_channel_success(channel)?))