https://github.com/wezterm/wezterm/pull/8209

diff --git a/wezterm-mux-server-impl/src/dispatch.rs b/wezterm-mux-server-impl/src/dispatch.rs
index c3728f1c2dc..161328a53fb 100644
--- a/wezterm-mux-server-impl/src/dispatch.rs
+++ b/wezterm-mux-server-impl/src/dispatch.rs
@@ -6,6 +6,7 @@ use futures::FutureExt;
 use mux::{Mux, MuxNotification};
 use smol::prelude::*;
 use smol::Async;
+use std::sync::Arc;
 use wezterm_uds::UnixStream;
 
 #[cfg(unix)]
@@ -58,10 +59,18 @@ where
     });
     let mut handler = SessionHandler::new(pdu_sender);
 
+    // The subscription is only removed by the next notification, which may
+    // come long after the client disconnects, so it holds the sender weakly
+    // to avoid keeping the channel and its buffers alive until then.
+    // See <https://github.com/wezterm/wezterm/issues/7363>
+    let notif_tx = Arc::new(item_tx);
     {
         let mux = Mux::get();
-        let tx = item_tx.clone();
-        mux.subscribe(move |n| tx.try_send(Item::Notif(n)).is_ok());
+        let tx = Arc::downgrade(&notif_tx);
+        mux.subscribe(move |n| match tx.upgrade() {
+            Some(tx) => tx.try_send(Item::Notif(n)).is_ok(),
+            None => false,
+        });
     }
 
     loop {
