From f7217aee8e126e0db19db3109ec1d7b34782b438 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Tue, 28 Jul 2020 03:30:47 -0600 Subject: [PATCH] Wait with output --- src/app.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app.rs b/src/app.rs index c006a9d..cc5cb80 100644 --- a/src/app.rs +++ b/src/app.rs @@ -420,17 +420,18 @@ impl App { // TODO: fix vim hanging match r { - Ok(mut child) => { - child - .wait() + Ok(child) => { + let output = child + .wait_with_output() .expect( &format!( "Cannot run `task edit` for task `{}`. Check documentation for more information", task_id )[..], ); - // TODO: should we sleep here to show output of the editor? - // std::thread::sleep(std::time::Duration::from_millis(500)); + if !output.status.success() { + // TODO: show error message here + } } _ => { println!("Vim failed to start");