-
-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The signal handlers for os.Interrupt and syscall.SIGTERM registered in the init function prevent Go's default behavior when receiving such a signal (exiting with an exit code which depends on the OS and/or signal):
Lines 31 to 43 in e376aa8
| func init() { | |
| color.ForceColor() | |
| // Make the cursor visible when the program stops | |
| c := make(chan os.Signal, 1) | |
| signal.Notify(c, os.Interrupt) | |
| signal.Notify(c, syscall.SIGTERM) | |
| go func() { | |
| for range c { | |
| cursor.Show() | |
| } | |
| }() | |
| } |
In effect, any program which merely imports pterm does not exit when handling a SIGINT (e.g. by pressing Ctrl+C) or a SIGTERM (e.g. by calling kill $PID).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working