diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rs index 4d13142549..ed4bbbefae 100644 --- a/crates/remote/src/ssh_session.rs +++ b/crates/remote/src/ssh_session.rs @@ -743,7 +743,11 @@ impl SshRemoteClient { loop { select_biased! { - _ = connection_activity_rx.next().fuse() => { + result = connection_activity_rx.next().fuse() => { + if result.is_none() { + log::warn!("ssh heartbeat: connection activity channel has been dropped. stopping."); + return Ok(()); + } keepalive_timer.set(cx.background_executor().timer(HEARTBEAT_INTERVAL).fuse()); } _ = keepalive_timer => {