diff options
Diffstat (limited to 'crates/dinggerd/src/snapshot.rs')
| -rw-r--r-- | crates/dinggerd/src/snapshot.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/dinggerd/src/snapshot.rs b/crates/dinggerd/src/snapshot.rs index 07316e8..d4ee321 100644 --- a/crates/dinggerd/src/snapshot.rs +++ b/crates/dinggerd/src/snapshot.rs @@ -97,8 +97,8 @@ pub struct PaneSnap { /// The agent running in the pane, if any. #[serde(default, skip_serializing_if = "Option::is_none")] pub agent: Option<AgentSnap>, - /// The command line running in the pane (not for agents with a - /// session): retyped on restore, not run. + /// The command line running in the pane: retyped on restore, not run + /// (an agent's, when its session cannot be resumed). #[serde(default, skip_serializing_if = "Option::is_none")] pub command: Option<String>, } @@ -249,8 +249,9 @@ pub fn capture(now_ms: u64) -> Option<Snapshot> { let command = if f[20] == "1" || leader.is_none() || at_prompt { None // the hook's text may be stale at a prompt } else if let Some(agent) = &agent { - // Resumed by session; otherwise retyped as it was started. - agent.session.is_none().then(|| hook_command.unwrap_or_else(|| agent.agent.clone())) + // Kept even with a session: restore retypes it when the session + // cannot be resumed (it never got a message, or its file is gone). + Some(hook_command.unwrap_or_else(|| agent.agent.clone())) } else { hook_command.or_else(|| leader.and_then(command_line)) }; |
