summaryrefslogtreecommitdiffstats
path: root/src/term.rs
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-04-13 17:51:09 +0200
committerrabite <rabite@posteo.de>2019-04-13 17:52:20 +0200
commit4c1f7e88a4eed75485209f18da04136635aa3909 (patch)
treec83d72b9c7f8059a904336536a4a349f1a3a84ec /src/term.rs
parent84d53f6afa08188037b93a5dc8d9e780a6fcd45f (diff)
properly reset terminal when quitting/crashing
Diffstat (limited to 'src/term.rs')
-rw-r--r--src/term.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/term.rs b/src/term.rs
index b55734d..4d9d228 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -37,7 +37,7 @@ impl Screen {
pub fn drop_screen(&mut self) {
self.cursor_show().log();
self.to_main_screen().log();
- self.screen = Arc::new(Mutex::new(None));
+ self.screen.lock().map(|mut screen| std::mem::drop(screen.take())).ok();
// Terminal stays fucked without this. Why?
Ok(std::process::Command::new("reset").arg("-I").spawn()).log();