From 8277b981042b58e095683b5781756599c40cc0a0 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 2 Aug 2022 11:58:24 -0700 Subject: [PATCH] Fixed bel bug --- crates/terminal/src/connected_view.rs | 5 +++++ crates/terminal/src/terminal.rs | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/terminal/src/connected_view.rs b/crates/terminal/src/connected_view.rs index bf8763da06..e6e10c84bf 100644 --- a/crates/terminal/src/connected_view.rs +++ b/crates/terminal/src/connected_view.rs @@ -105,6 +105,7 @@ impl ConnectedView { ///Synthesize the keyboard event corresponding to 'up' fn up(&mut self, _: &Up, cx: &mut ViewContext) { + self.clear_bel(cx); self.terminal .read(cx) .try_keystroke(&Keystroke::parse("up").unwrap()); @@ -112,6 +113,7 @@ impl ConnectedView { ///Synthesize the keyboard event corresponding to 'down' fn down(&mut self, _: &Down, cx: &mut ViewContext) { + self.clear_bel(cx); self.terminal .read(cx) .try_keystroke(&Keystroke::parse("down").unwrap()); @@ -119,6 +121,7 @@ impl ConnectedView { ///Synthesize the keyboard event corresponding to 'ctrl-c' fn ctrl_c(&mut self, _: &CtrlC, cx: &mut ViewContext) { + self.clear_bel(cx); self.terminal .read(cx) .try_keystroke(&Keystroke::parse("ctrl-c").unwrap()); @@ -126,6 +129,7 @@ impl ConnectedView { ///Synthesize the keyboard event corresponding to 'escape' fn escape(&mut self, _: &Escape, cx: &mut ViewContext) { + self.clear_bel(cx); self.terminal .read(cx) .try_keystroke(&Keystroke::parse("escape").unwrap()); @@ -133,6 +137,7 @@ impl ConnectedView { ///Synthesize the keyboard event corresponding to 'enter' fn enter(&mut self, _: &Enter, cx: &mut ViewContext) { + self.clear_bel(cx); self.terminal .read(cx) .try_keystroke(&Keystroke::parse("enter").unwrap()); diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 45e46ce378..878e646c05 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -377,7 +377,6 @@ impl TerminalBuilder { loop { let utilization = match this.upgrade(&cx) { Some(this) => this.update(&mut cx, |this, cx| { - cx.emit(Event::Wakeup); cx.notify(); this.utilization() }), @@ -453,7 +452,7 @@ impl Terminal { //NOOP, Handled in render } AlacTermEvent::Wakeup => { - //NOOP, Handled elsewhere + cx.emit(Event::Wakeup); } AlacTermEvent::ColorRequest(_, _) => { self.events.push(InternalEvent::TermEvent(event.clone()))