mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 17:27:39 +02:00
Give the kill signal time to be delivered
This commit is contained in:
@@ -273,14 +273,20 @@ func (self *Loop) ScreenSize() (ScreenSize, error) {
|
|||||||
return self.screen_size, err
|
return self.screen_size, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func kill_self(sig unix.Signal) {
|
||||||
|
unix.Kill(os.Getpid(), sig)
|
||||||
|
// Give the signal time to be delivered
|
||||||
|
time.Sleep(20 * time.Millisecond)
|
||||||
|
}
|
||||||
|
|
||||||
func (self *Loop) KillIfSignalled() {
|
func (self *Loop) KillIfSignalled() {
|
||||||
switch self.death_signal {
|
switch self.death_signal {
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
unix.Kill(os.Getpid(), unix.SIGINT)
|
kill_self(unix.SIGINT)
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
unix.Kill(os.Getpid(), unix.SIGTERM)
|
kill_self(unix.SIGTERM)
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
unix.Kill(os.Getpid(), unix.SIGHUP)
|
kill_self(unix.SIGHUP)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user