feat(ssh): validate terminal emulator support
Some checks failed
CI / Test Suite (push) Has been cancelled
CI / Rustfmt (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Docs (push) Has been cancelled
Some checks failed
CI / Test Suite (push) Has been cancelled
CI / Rustfmt (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Docs (push) Has been cancelled
This commit is contained in:
parent
d22b1c3a34
commit
1f72560438
1 changed files with 9 additions and 3 deletions
12
src/ssh.rs
12
src/ssh.rs
|
@ -119,7 +119,7 @@ impl Handler for SshSession {
|
||||||
|
|
||||||
Err(eyre!("Failed to initialize App for session"))
|
Err(eyre!("Failed to initialize App for session"))
|
||||||
}
|
}
|
||||||
#[instrument(skip(self, _session), level = "trace")]
|
#[instrument(skip(self, session), level = "trace")]
|
||||||
async fn pty_request(
|
async fn pty_request(
|
||||||
&mut self,
|
&mut self,
|
||||||
channel_id: ChannelId,
|
channel_id: ChannelId,
|
||||||
|
@ -129,10 +129,16 @@ impl Handler for SshSession {
|
||||||
pix_width: u32,
|
pix_width: u32,
|
||||||
pix_height: u32,
|
pix_height: u32,
|
||||||
modes: &[(Pty, u32)],
|
modes: &[(Pty, u32)],
|
||||||
_session: &mut Session,
|
session: &mut Session,
|
||||||
) -> Result<(), Self::Error> {
|
) -> Result<(), Self::Error> {
|
||||||
tracing::info!("Received pty request from channel {channel_id}");
|
tracing::info!("Received pty request from channel {channel_id}; terminal: {term}");
|
||||||
tracing::debug!("dims: {col_width} * {row_height}, pixel: {pix_width} * {pix_height}");
|
tracing::debug!("dims: {col_width} * {row_height}, pixel: {pix_width} * {pix_height}");
|
||||||
|
|
||||||
|
if !term.contains("xterm") {
|
||||||
|
session.channel_failure(channel_id)?;
|
||||||
|
return Err(eyre!("Unsupported terminal type: {term}"));
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue