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'
fn up(&mut self, _: &Up, cx: &mut ViewContext<Self>) {
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>) {
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>) {
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>) {
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>) {
self.clear_bel(cx);
self.terminal
.read(cx)
.try_keystroke(&Keystroke::parse("enter").unwrap());

View File

@ -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()))