make terminal initialization a little more reliable
HEAD mainthis had been getting noticeable during debugging flows that involved lots of panics
Force-Push: yes
Change-Id: Ic4a8855467a1f96e12965338726069c9d66f821e
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?;
|