summary refs log tree commit diff
path: root/src/terminal.rs
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-03-27 17:44:49 -0700
committerIrene Knapp <ireneista@irenes.space>2026-03-27 17:44:49 -0700
commitfd8a530e27c93d7484a90e2b96ad765436d0dad3 (patch)
tree20ad3cb4bd327b62b954b86041c5fde6f186e677 /src/terminal.rs
parent2b81a83337263bcea71953e598b09afbd47c5719 (diff)
make terminal initialization a little more reliable HEAD main
this had been getting noticeable during debugging flows that involved lots of panics

Force-Push: yes
Change-Id: Ic4a8855467a1f96e12965338726069c9d66f821e
Diffstat (limited to 'src/terminal.rs')
-rw-r--r--src/terminal.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/terminal.rs b/src/terminal.rs
index d6cfc69..c46a4a2 100644
--- a/src/terminal.rs
+++ b/src/terminal.rs
@@ -74,7 +74,13 @@ impl Terminal {
   }
 
   pub async fn init_full_screen(&mut self) -> Result<()> {
+    /* Theoretically, xterm clears the alternate screen buffer when switching
+     * into it. Konsole does not necessarily do so, so we add an explicit
+     * clear. This is only noticeable when we fail to exit cleanly and return
+     * to the shell while still in the alternate screen buffer.
+     */
     self.start_alternate_screen().await?;
+    self.clear().await?;
     self.set_cursor_position(0, 0).await?;
 
     let (width, height) = self.report_size().await?;