aboutsummaryrefslogtreecommitdiff
path: root/src/terminal
diff options
context:
space:
mode:
authorzhugehyuk <icedac@users.noreply.github.com>2026-05-25 03:28:33 +0900
committerGitHub <noreply@github.com>2026-05-24 21:28:33 +0300
commit43c6ca3a5dbdcefc6c6dc29be9ce81d990baf39e (patch)
tree73be12f81129dab324ea08901c733a6a56ec0e61 /src/terminal
parent5ce738cf5397d0d8a50ed1aa6335297073cc0f0f (diff)
feat: persist pane history across restarts (#248)
refs #217 Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/terminal')
-rw-r--r--src/terminal/runtime.rs37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/terminal/runtime.rs b/src/terminal/runtime.rs
index be69b713..2aa49b68 100644
--- a/src/terminal/runtime.rs
+++ b/src/terminal/runtime.rs
@@ -46,6 +46,35 @@ impl TerminalRuntime {
.map(Self)
}
+ pub fn spawn_with_initial_history(
+ pane_id: PaneId,
+ rows: u16,
+ cols: u16,
+ cwd: std::path::PathBuf,
+ scrollback_limit_bytes: usize,
+ host_terminal_theme: crate::terminal_theme::TerminalTheme,
+ default_shell: &str,
+ initial_history_ansi: Option<&str>,
+ events: mpsc::Sender<AppEvent>,
+ render_notify: Arc<Notify>,
+ render_dirty: Arc<AtomicBool>,
+ ) -> std::io::Result<Self> {
+ crate::pane::PaneRuntime::spawn_with_initial_history(
+ pane_id,
+ rows,
+ cols,
+ cwd,
+ scrollback_limit_bytes,
+ host_terminal_theme,
+ default_shell,
+ initial_history_ansi,
+ events,
+ render_notify,
+ render_dirty,
+ )
+ .map(Self)
+ }
+
pub fn spawn_shell_command(
pane_id: PaneId,
rows: u16,
@@ -107,7 +136,7 @@ impl TerminalRuntime {
rows: u16,
cols: u16,
cwd: std::path::PathBuf,
- restore_plan: &crate::agent_resume::AgentResumePlan,
+ launch: crate::agent_resume::AgentResumeLaunch<'_>,
scrollback_limit_bytes: usize,
host_terminal_theme: crate::terminal_theme::TerminalTheme,
default_shell: &str,
@@ -120,7 +149,7 @@ impl TerminalRuntime {
rows,
cols,
cwd,
- restore_plan,
+ launch,
scrollback_limit_bytes,
host_terminal_theme,
default_shell,
@@ -199,6 +228,10 @@ impl TerminalRuntime {
self.0.recent_unwrapped_ansi(lines)
}
+ pub fn snapshot_history(&self) -> Option<String> {
+ self.0.snapshot_history()
+ }
+
pub fn extract_selection(&self, selection: &crate::selection::Selection) -> Option<String> {
self.0.extract_selection(selection)
}