Fixed bel bug

This commit is contained in:
Mikayla Maki 2022-08-02 11:58:24 -07:00
parent 937cd582e8
commit 8277b98104
2 changed files with 6 additions and 2 deletions

View file

@ -105,6 +105,7 @@ impl ConnectedView {
///Synthesize the keyboard event corresponding to 'up' ///Synthesize the keyboard event corresponding to 'up'
fn up(&mut self, _: &Up, cx: &mut ViewContext<Self>) { fn up(&mut self, _: &Up, cx: &mut ViewContext<Self>) {
self.clear_bel(cx);
self.terminal self.terminal
.read(cx) .read(cx)
.try_keystroke(&Keystroke::parse("up").unwrap()); .try_keystroke(&Keystroke::parse("up").unwrap());
@ -112,6 +113,7 @@ impl ConnectedView {
///Synthesize the keyboard event corresponding to 'down' ///Synthesize the keyboard event corresponding to 'down'
fn down(&mut self, _: &Down, cx: &mut ViewContext<Self>) { fn down(&mut self, _: &Down, cx: &mut ViewContext<Self>) {
self.clear_bel(cx);
self.terminal self.terminal
.read(cx) .read(cx)
.try_keystroke(&Keystroke::parse("down").unwrap()); .try_keystroke(&Keystroke::parse("down").unwrap());
@ -119,6 +121,7 @@ impl ConnectedView {
///Synthesize the keyboard event corresponding to 'ctrl-c' ///Synthesize the keyboard event corresponding to 'ctrl-c'
fn ctrl_c(&mut self, _: &CtrlC, cx: &mut ViewContext<Self>) { fn ctrl_c(&mut self, _: &CtrlC, cx: &mut ViewContext<Self>) {
self.clear_bel(cx);
self.terminal self.terminal
.read(cx) .read(cx)
.try_keystroke(&Keystroke::parse("ctrl-c").unwrap()); .try_keystroke(&Keystroke::parse("ctrl-c").unwrap());
@ -126,6 +129,7 @@ impl ConnectedView {
///Synthesize the keyboard event corresponding to 'escape' ///Synthesize the keyboard event corresponding to 'escape'
fn escape(&mut self, _: &Escape, cx: &mut ViewContext<Self>) { fn escape(&mut self, _: &Escape, cx: &mut ViewContext<Self>) {
self.clear_bel(cx);
self.terminal self.terminal
.read(cx) .read(cx)
.try_keystroke(&Keystroke::parse("escape").unwrap()); .try_keystroke(&Keystroke::parse("escape").unwrap());
@ -133,6 +137,7 @@ impl ConnectedView {
///Synthesize the keyboard event corresponding to 'enter' ///Synthesize the keyboard event corresponding to 'enter'
fn enter(&mut self, _: &Enter, cx: &mut ViewContext<Self>) { fn enter(&mut self, _: &Enter, cx: &mut ViewContext<Self>) {
self.clear_bel(cx);
self.terminal self.terminal
.read(cx) .read(cx)
.try_keystroke(&Keystroke::parse("enter").unwrap()); .try_keystroke(&Keystroke::parse("enter").unwrap());

View file

@ -377,7 +377,6 @@ impl TerminalBuilder {
loop { loop {
let utilization = match this.upgrade(&cx) { let utilization = match this.upgrade(&cx) {
Some(this) => this.update(&mut cx, |this, cx| { Some(this) => this.update(&mut cx, |this, cx| {
cx.emit(Event::Wakeup);
cx.notify(); cx.notify();
this.utilization() this.utilization()
}), }),
@ -453,7 +452,7 @@ impl Terminal {
//NOOP, Handled in render //NOOP, Handled in render
} }
AlacTermEvent::Wakeup => { AlacTermEvent::Wakeup => {
//NOOP, Handled elsewhere cx.emit(Event::Wakeup);
} }
AlacTermEvent::ColorRequest(_, _) => { AlacTermEvent::ColorRequest(_, _) => {
self.events.push(InternalEvent::TermEvent(event.clone())) self.events.push(InternalEvent::TermEvent(event.clone()))