From 6e18f2d32f36f36c8fb24f44f5e2b67f379a6a8f Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 17 Nov 2022 11:17:13 -0800 Subject: [PATCH] Merge pull request #1900 from zed-industries/fix-terminal-performance Check for wakeups correctly --- crates/terminal/src/terminal.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 8b5b20e81e..7e469e19fe 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -429,17 +429,18 @@ impl TerminalBuilder { } } - if events.is_empty() { + if events.is_empty() && wakeup == false { smol::future::yield_now().await; break 'outer; } else { this.upgrade(&cx)?.update(&mut cx, |this, cx| { - for event in events { - this.process_event(&event, cx); - } if wakeup { this.process_event(&AlacTermEvent::Wakeup, cx); } + + for event in events { + this.process_event(&event, cx); + } }); smol::future::yield_now().await; }