mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-21 16:02:20 +00:00
fix(pane): say when a restore is not asked for
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.
This commit is contained in:
+19
-5
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user