From e2e8d94b147c164c9c0bf8c2b70e84eb3395657c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 7 Mar 2021 11:30:26 +0900 Subject: Kill input command on terminate Fix #2381 Close #2382 --- src/core.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core.go') diff --git a/src/core.go b/src/core.go index a18c3a18..d9a83bd4 100644 --- a/src/core.go +++ b/src/core.go @@ -254,7 +254,11 @@ func Run(opts *Options, version string, revision string) { } for evt, value := range *events { switch evt { - + case EvtQuit: + if reading { + reader.terminate() + } + os.Exit(value.(int)) case EvtReadNew, EvtReadFin: if evt == EvtReadFin && nextCommand != nil { restart(*nextCommand) -- cgit v1.2.3