aboutsummaryrefslogtreecommitdiff
path: root/src/terminal
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-28 04:11:56 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-28 04:12:53 +0300
commitbf9cc201244946496b4d950046bf7edcc4892994 (patch)
tree920c866e67783cf31d2feff9642457204999c8eb /src/terminal
parent789738cada5afaa20bbd77a0d479fb689c455bfe (diff)
fix: preserve live handoff terminal state
Diffstat (limited to 'src/terminal')
-rw-r--r--src/terminal/runtime.rs15
-rw-r--r--src/terminal/state.rs7
2 files changed, 16 insertions, 6 deletions
diff --git a/src/terminal/runtime.rs b/src/terminal/runtime.rs
index fa81aa4a..636972a1 100644
--- a/src/terminal/runtime.rs
+++ b/src/terminal/runtime.rs
@@ -45,8 +45,11 @@ impl TerminalRuntime {
}
#[cfg(unix)]
- pub fn handoff_pane(&self, pane_id: u32) -> crate::server::handoff::HandoffPane {
- self.0.handoff_pane(pane_id)
+ pub fn handoff_runtime_state(
+ &self,
+ pane_id: u32,
+ ) -> crate::handoff_runtime::HandoffRuntimeState {
+ self.0.handoff_runtime_state(pane_id)
}
#[cfg(unix)]
@@ -56,7 +59,7 @@ impl TerminalRuntime {
#[cfg(unix)]
pub fn from_handoff_fd(
- import: crate::pane::PaneRuntimeImport,
+ import: crate::handoff_runtime::ImportedHandoffRuntime,
scrollback_limit_bytes: usize,
host_terminal_theme: crate::terminal_theme::TerminalTheme,
events: mpsc::Sender<AppEvent>,
@@ -369,14 +372,14 @@ impl TerminalRuntime {
pub fn cwd(&self) -> Option<std::path::PathBuf> {
self.0.cwd()
}
-}
-#[cfg(test)]
-impl TerminalRuntime {
pub(crate) fn current_size(&self) -> (u16, u16) {
self.0.current_size()
}
+}
+#[cfg(test)]
+impl TerminalRuntime {
pub(crate) fn test_with_channel(cols: u16, rows: u16) -> (Self, mpsc::Receiver<Bytes>) {
let (runtime, rx) = crate::pane::PaneRuntime::test_with_channel(cols, rows);
(Self(runtime), rx)
diff --git a/src/terminal/state.rs b/src/terminal/state.rs
index d713118c..f061e318 100644
--- a/src/terminal/state.rs
+++ b/src/terminal/state.rs
@@ -72,6 +72,7 @@ pub struct TerminalState {
pub state: AgentState,
pub revision: u64,
pub launch_argv: Option<Vec<String>>,
+ pub respawn_shell_on_exit: bool,
}
impl TerminalState {
@@ -96,6 +97,7 @@ impl TerminalState {
state: AgentState::Unknown,
revision: 0,
launch_argv: None,
+ respawn_shell_on_exit: false,
}
}
@@ -104,6 +106,11 @@ impl TerminalState {
self
}
+ pub fn with_respawn_shell_on_exit(mut self) -> Self {
+ self.respawn_shell_on_exit = true;
+ self
+ }
+
#[cfg(test)]
pub fn set_detected_state(
&mut self,