diff options
Diffstat (limited to 'src/pane/terminal.rs')
| -rw-r--r-- | src/pane/terminal.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pane/terminal.rs b/src/pane/terminal.rs index 5c7dfcb9..06cdea35 100644 --- a/src/pane/terminal.rs +++ b/src/pane/terminal.rs @@ -445,6 +445,10 @@ impl PaneTerminal { .maybe_restore_host_terminal_theme(pane_id, shell_pid) } + pub fn terminal_title(&self) -> Option<String> { + self.ghostty.terminal_title() + } + #[allow(dead_code)] // exposed for Stage C (detection loop wiring) pub fn agent_osc_title(&self) -> String { self.ghostty.agent_osc_title() @@ -985,6 +989,20 @@ impl GhosttyPaneTerminal { ) } + pub fn terminal_title(&self) -> Option<String> { + self.core + .lock() + .ok() + .and_then(|core| core.agent_osc_state.terminal_title().map(str::to_string)) + } + + #[cfg(unix)] + pub fn seed_terminal_title(&self, title: Option<String>) { + if let Ok(mut core) = self.core.lock() { + core.agent_osc_state.seed_terminal_title(title); + } + } + /// Returns the latest OSC 0/2 title retained for agent detection, or `""` /// if no title has been seen or the last update was an empty clear. #[allow(dead_code)] // exposed for Stage C (detection loop wiring) |
