diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-19 14:47:18 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-19 14:47:18 +0300 |
| commit | cc7c696cd0772e466da403eb4e3f00f4e8d8ae1e (patch) | |
| tree | d8325f7f2fb1ac53613ae56e8215042e6d497dd9 /src/pane | |
| parent | 3f2a6e743f67bc947cfa06be25df106d00b9ee11 (diff) | |
feat: add configurable pane screen and scrollback clearing (#4383)
Diffstat (limited to 'src/pane')
| -rw-r--r-- | src/pane/terminal.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pane/terminal.rs b/src/pane/terminal.rs index 4a6bc173..4d7f07b1 100644 --- a/src/pane/terminal.rs +++ b/src/pane/terminal.rs @@ -258,6 +258,10 @@ impl PaneTerminal { self.ghostty.scroll_reset(); } + pub fn clear_screen(&self) -> Result<(), String> { + self.ghostty.clear_screen() + } + pub fn set_scroll_offset_from_bottom(&self, lines: usize) { self.ghostty.set_scroll_offset_from_bottom(lines); } @@ -1773,6 +1777,21 @@ impl GhosttyPaneTerminal { } } + pub fn clear_screen(&self) -> Result<(), String> { + let mut core = self + .core + .lock() + .map_err(|_| "terminal lock poisoned".to_owned())?; + if core.terminal.clear_screen() { + #[cfg(windows)] + { + core.recent_fallback = windows_recent_fallback::Cache::default(); + windows_recent_fallback::update(&mut core); + } + } + Ok(()) + } + pub fn set_scroll_offset_from_bottom(&self, lines: usize) { if let Ok(mut core) = self.core.lock() { #[cfg(windows)] |
