Handle SIGTERM gracefully (#482)

This commit is contained in:
Junegunn Choi 2016-02-02 17:51:21 +09:00
parent 82067463b8
commit 1893eca41a

View File

@ -734,7 +734,7 @@ func (t *Terminal) Loop() {
<-t.startChan
{ // Late initialization
intChan := make(chan os.Signal, 1)
signal.Notify(intChan, os.Interrupt, os.Kill)
signal.Notify(intChan, os.Interrupt, os.Kill, syscall.SIGTERM)
go func() {
<-intChan
t.reqBox.Set(reqQuit, nil)