1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 06:54:45 +03:00

ssh: Improve some logging/diagnostics

This commit is contained in:
Wez Furlong 2021-10-18 07:11:42 -07:00
parent a8b64a2756
commit bd47566681
2 changed files with 26 additions and 2 deletions

View File

@ -191,7 +191,13 @@ impl crate::session::SessionInner {
// Depending on the server configuration, a given
// setenv request may not succeed, but that doesn't
// prevent the connection from being set up.
log::warn!("ssh: setenv {}={} failed: {}", key, val, err);
log::warn!(
"ssh: setenv {}={} failed: {}. \
Check the AcceptEnv setting on the ssh server side.",
key,
val,
err
);
}
}
}

View File

@ -406,6 +406,13 @@ impl SessionInner {
.ok_or_else(|| anyhow!("port is always set in config loader"))?
.parse::<u16>()?;
self.tx_event
.try_send(SessionEvent::Banner(Some(format!(
"Using libssh-rs to connect to {}@{}:{}",
user, hostname, port
))))
.context("notifying user of banner")?;
let sess = libssh::Session::new()?;
// sess.set_option(libssh::SshOption::LogLevel(libssh::LogLevel::Packet))?;
sess.set_option(libssh::SshOption::Hostname(hostname.clone()))?;
@ -455,6 +462,13 @@ impl SessionInner {
.parse::<u16>()?;
let remote_address = format!("{}:{}", hostname, port);
self.tx_event
.try_send(SessionEvent::Banner(Some(format!(
"Using ssh2 to connect to {}@{}:{}",
user, hostname, port
))))
.context("notifying user of banner")?;
let tcp: TcpStream = if let Some(proxy_command) =
self.config.get("proxycommand").and_then(|c| {
if !c.is_empty() && c != "none" {
@ -658,7 +672,11 @@ impl SessionInner {
);
out.fd.take();
} else {
log::trace!("Failed to read data from channel: {:#}, but still have some buffer to drain", err);
log::trace!(
"Failed to read data from channel: {:#}, but \
still have some buffer to drain",
err
);
}
}
}