From fd8a530e27c93d7484a90e2b96ad765436d0dad3 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 27 Mar 2026 17:44:49 -0700 Subject: make terminal initialization a little more reliable this had been getting noticeable during debugging flows that involved lots of panics Force-Push: yes Change-Id: Ic4a8855467a1f96e12965338726069c9d66f821e --- src/terminal.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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?; -- cgit 1.4.1