1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 05:12:40 +03:00

ssh: reduce some redundant logging around AcceptEnv

just show it once at warn level and drop it to debug after that.
This commit is contained in:
Wez Furlong 2022-08-30 19:14:56 -07:00
parent ad9490ee8f
commit 9721900b16
3 changed files with 22 additions and 7 deletions

View File

@ -228,13 +228,26 @@ impl crate::sessioninner::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: {}. \
Check the AcceptEnv setting on the ssh server side.",
key,
val,
err
);
if !self.shown_accept_env_error {
log::warn!(
"ssh: setenv {}={} failed: {}. \
Check the AcceptEnv setting on the ssh server side. \
Additional errors with setting env vars in this \
session will be logged at debug log level.",
key,
val,
err
);
self.shown_accept_env_error = true;
} else {
log::debug!(
"ssh: setenv {}={} failed: {}. \
Check the AcceptEnv setting on the ssh server side.",
key,
val,
err
);
}
}
}
}

View File

@ -103,6 +103,7 @@ impl Session {
next_file_id: 1,
sender_read,
session_was_dropped: false,
shown_accept_env_error: false,
};
std::thread::spawn(move || inner.run());
Ok((Self { tx: session_sender }, rx_event))

View File

@ -47,6 +47,7 @@ pub(crate) struct SessionInner {
pub next_file_id: FileId,
pub sender_read: FileDescriptor,
pub session_was_dropped: bool,
pub shown_accept_env_error: bool,
}
impl Drop for SessionInner {