Fixed mouse captures issue with the terminal

This commit is contained in:
ChristianVisintin
2020-12-06 10:55:15 +01:00
parent e956327b47
commit 357c0c9189
2 changed files with 4 additions and 2 deletions

View File

@@ -113,6 +113,8 @@ impl ActivityManager {
None => break, // Exit None => break, // Exit
} }
} }
// Drop context
drop(self.context.take());
} }
// Loops // Loops

View File

@@ -33,7 +33,7 @@ use crate::host::Localhost;
// Includes // Includes
use crossterm::execute; use crossterm::execute;
use crossterm::event::{EnableMouseCapture, DisableMouseCapture}; use crossterm::event::DisableMouseCapture;
use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen}; use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen};
use std::io::{stdout, Stdout, Write}; use std::io::{stdout, Stdout, Write};
use tui::backend::CrosstermBackend; use tui::backend::CrosstermBackend;
@@ -55,7 +55,7 @@ impl Context {
pub fn new(local: Localhost) -> Context { pub fn new(local: Localhost) -> Context {
// Create terminal // Create terminal
let mut stdout = stdout(); let mut stdout = stdout();
assert!(execute!(stdout, EnterAlternateScreen, EnableMouseCapture).is_ok()); assert!(execute!(stdout, EnterAlternateScreen).is_ok());
Context { Context {
local: local, local: local,
input_hnd: InputHandler::new(), input_hnd: InputHandler::new(),