From b8f61109f7d22a09458d78681155150f39a12269 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 25 Feb 2022 20:59:40 -0500 Subject: don't error when sending events during application shutdown --- src/shell/history/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/shell/history/mod.rs') diff --git a/src/shell/history/mod.rs b/src/shell/history/mod.rs index 2eeab0b..6d38891 100644 --- a/src/shell/history/mod.rs +++ b/src/shell/history/mod.rs @@ -86,7 +86,7 @@ impl History { &mut self, cmdline: &str, env: &Env, - event_w: tokio::sync::mpsc::UnboundedSender, + event_w: crate::shell::event::Writer, ) -> anyhow::Result { let (input_w, input_r) = tokio::sync::mpsc::unbounded_channel(); let (resize_w, resize_r) = tokio::sync::mpsc::unbounded_channel(); @@ -223,7 +223,7 @@ fn run_commands( mut env: Env, input_r: tokio::sync::mpsc::UnboundedReceiver>, resize_r: tokio::sync::mpsc::UnboundedReceiver<(u16, u16)>, - event_w: tokio::sync::mpsc::UnboundedSender, + event_w: crate::shell::event::Writer, ) { tokio::task::spawn(async move { let pty = match pty::Pty::new( @@ -278,7 +278,7 @@ async fn spawn_commands( cmdline: &str, pty: &pty::Pty, env: &mut Env, - event_w: tokio::sync::mpsc::UnboundedSender, + event_w: crate::shell::event::Writer, ) -> anyhow::Result { enum Res { Read(crate::runner::Event), @@ -339,10 +339,10 @@ async fn spawn_commands( match res { Res::Read(event) => match event { crate::runner::Event::RunPipeline(idx, span) => { - event_w.send(Event::ChildRunPipeline(idx, span)).unwrap(); + event_w.send(Event::ChildRunPipeline(idx, span)); } crate::runner::Event::Suspend(idx) => { - event_w.send(Event::ChildSuspend(idx)).unwrap(); + event_w.send(Event::ChildSuspend(idx)); } crate::runner::Event::Exit(new_env) => { *env = new_env; -- cgit v1.2.3-54-g00ecf