Merge pull request #105 from kdheepak/fix-alacritty-bug

This commit is contained in:
Dheepak Krishnamurthy 2021-02-15 10:41:43 -07:00 committed by GitHub
commit 4b92e6e957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View file

@ -5,9 +5,6 @@ on:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
build:

View file

@ -144,7 +144,7 @@ impl Events {
pub fn pause_key_capture(&self, terminal: &mut Terminal<CrosstermBackend<io::Stdout>>) {
self.pause_event_loop();
thread::sleep(Duration::from_millis(250));
terminal.flush().unwrap();
disable_raw_mode().unwrap();
execute!(io::stdout(), LeaveAlternateScreen, DisableMouseCapture).unwrap();
terminal.show_cursor().unwrap();
@ -153,7 +153,7 @@ impl Events {
pub fn resume_key_capture(&self, terminal: &mut Terminal<CrosstermBackend<io::Stdout>>) {
execute!(io::stdout(), EnterAlternateScreen, EnableMouseCapture).unwrap();
enable_raw_mode().unwrap();
thread::sleep(Duration::from_millis(250));
terminal.flush().unwrap();
self.resume_event_loop();
terminal.resize(terminal.size().unwrap()).unwrap();
}