From 3093babdddcda2f2de3cde55aa533ed4d73ed451 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Mon, 10 Aug 2026 15:33:26 +0800 Subject: [PATCH] fix(pane): say when a restore is not asked for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dropping the request here produced a blank pane, which is also what a pane with nothing stored looks like and what a daemon that refused would produce. Three causes and one appearance, with nothing anywhere to tell them apart — the filter was silent, so reading the source was the only way to find out which had happened. --- src/terminal/remote.rs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/terminal/remote.rs b/src/terminal/remote.rs index 51ba3362..6ce9ca85 100644 --- a/src/terminal/remote.rs +++ b/src/terminal/remote.rs @@ -311,11 +311,25 @@ impl RemoteTerminal { // predates the field would silently drop it. Sending it anyway would // cost nothing but would make the log claim a restore that never // happened, so the local case is the only one that asks. - let restore = restore.filter(|_| { - route.is_local() - && crate::daemon::spawn::local_daemon_supports( - crate::daemon::protocol::FEATURE_RESTORE_SCROLLBACK, - ) + let restore = restore.and_then(|want| { + let local = route.is_local(); + let supported = crate::daemon::spawn::local_daemon_supports( + crate::daemon::protocol::FEATURE_RESTORE_SCROLLBACK, + ); + if local && supported { + return Some(want); + } + // Said out loud, because the symptom of dropping it here is a pane + // that opens blank — which is also what a pane with nothing stored + // looks like, and what a daemon that refused would produce. Three + // causes, one appearance; without this line the only way to tell + // them apart is to read the source. + log::info!( + "not asking to restore pane {}'s screen: local={local} \ + daemon-supports-restore={supported}", + want.pane_id + ); + None }); ClientMsg::Spawn {