Kill input command on terminate

Fix #2381
Close #2382
This commit is contained in:
Junegunn Choi
2021-03-07 11:30:26 +09:00
parent 4f9a7f8c87
commit e2e8d94b14
3 changed files with 24 additions and 16 deletions

View File

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