mirror of
https://github.com/yudai/gotty.git
synced 2025-12-31 14:48:49 +01:00
Show message for force exit
This commit is contained in:
parent
ff92777011
commit
05d9267f20
2 changed files with 8 additions and 3 deletions
4
main.go
4
main.go
|
|
@ -120,7 +120,9 @@ func registerSignals(app *app.App) {
|
|||
s := <-sigChan
|
||||
switch s {
|
||||
case syscall.SIGINT, syscall.SIGTERM:
|
||||
if !app.Exit() {
|
||||
if app.Exit() {
|
||||
fmt.Println("Send ^C to force exit.")
|
||||
} else {
|
||||
os.Exit(5)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue