From 07d94f65e8c7113e22c44a8c786ad36b5b5d5a20 Mon Sep 17 00:00:00 2001 From: Jannik Kolodziej Date: Sun, 2 Jun 2024 16:36:22 +0200 Subject: [PATCH] fix(app): enable focus change events on linux --- src/tui.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tui.rs b/src/tui.rs index 84fb44d..d1bd465 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -1,6 +1,6 @@ use std::{io, panic}; use std::collections::HashMap; -use crossterm::event::KeyEvent; +use crossterm::event::{DisableFocusChange, EnableFocusChange, KeyEvent}; use crossterm::terminal; use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen}; use log::{debug}; @@ -31,7 +31,7 @@ impl Tui { } pub fn init(&mut self) -> AppResult<()> { terminal::enable_raw_mode()?; - crossterm::execute!(io::stderr(), EnterAlternateScreen)?; + crossterm::execute!(io::stderr(), EnterAlternateScreen, EnableFocusChange)?; let panic_hook = panic::take_hook(); panic::set_hook(Box::new(move |panic| { @@ -60,7 +60,7 @@ impl Tui { fn reset() -> AppResult<()> { terminal::disable_raw_mode()?; - crossterm::execute!(io::stderr(), LeaveAlternateScreen)?; + crossterm::execute!(io::stderr(), LeaveAlternateScreen, DisableFocusChange)?; Ok(()) }