From d51e99adc16c375dacea6f5c07d9bfcdfcfd4b0f Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Fri, 16 Sep 2016 15:22:39 +0300 Subject: [PATCH] close pipe and then wait command in a separate goroutine Mentioned in #5. --- ui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui.go b/ui.go index e04b7c5..7ab1bc5 100644 --- a/ui.go +++ b/ui.go @@ -353,7 +353,8 @@ func (ui *UI) loadFile(nav *Nav) { log.Print(msg) } - defer cmd.Wait() + defer out.Close() + go func() { defer cmd.Wait() }() reader = out } else { f, err := os.Open(path)