diff options
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)] |
