diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-06 23:06:00 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-06 23:06:00 +0300 |
| commit | 56edcbcba83b8ff7f6f69ee4231f163e97df3346 (patch) | |
| tree | e6eb1c31fd8f9a317fe1d6d49b019037f14b4746 /src/app/creation.rs | |
| parent | efceb30f0b447196615e3b2821d12ef82adcb3e2 (diff) | |
feat: expose pane scroll state
Diffstat (limited to 'src/app/creation.rs')
| -rw-r--r-- | src/app/creation.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/app/creation.rs b/src/app/creation.rs index bfc4cd03..13fc0a8e 100644 --- a/src/app/creation.rs +++ b/src/app/creation.rs @@ -375,6 +375,15 @@ impl App { let pane = ws.pane_state(pane_id)?; let terminal = self.state.terminals.get(&pane.attached_terminal_id)?; let tab_idx = ws.find_tab_index_for_pane(pane_id)?; + let scroll = self + .state + .runtime_for_pane_in_workspace(&self.terminal_runtimes, ws_idx, pane_id) + .and_then(|runtime| runtime.scroll_metrics()) + .map(|metrics| crate::api::schema::PaneScrollInfo { + offset_from_bottom: metrics.offset_from_bottom as u64, + max_offset_from_bottom: metrics.max_offset_from_bottom as u64, + viewport_rows: metrics.viewport_rows as u64, + }); let focused = self.state.active == Some(ws_idx) && ws.active_tab == tab_idx && ws @@ -401,6 +410,7 @@ impl App { custom_status: presentation.custom_status, state_labels: presentation.state_labels, agent_session: terminal_agent_session_info(terminal), + scroll, revision: terminal.revision, }) } |
