diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-13 03:26:03 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-13 03:30:13 +0300 |
| commit | 5cfe5e5e730246948b0c9428ad876b6938590aad (patch) | |
| tree | 53d4bbe1aff6887f63f279eed1b5e4e11e7331b7 /src/pane/terminal.rs | |
| parent | 7f3364a468f7dcfd8c9c84e5737fe5699f0e3a93 (diff) | |
feat: add configurable sidebar metadata tokens
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) |
