mirror of
https://github.com/Hilbis/Hilbish
synced 2025-03-29 09:43:22 +00:00
24 lines
299 B
Go
24 lines
299 B
Go
//go:build windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
)
|
|
|
|
func handleSignals() {
|
|
c := make(chan os.Signal)
|
|
signal.Notify(c, os.Interrupt)
|
|
|
|
for s := range c {
|
|
switch s {
|
|
case os.Interrupt:
|
|
hooks.Emit("signal.sigint")
|
|
if !running && interactive {
|
|
lr.ClearInput()
|
|
}
|
|
}
|
|
}
|
|
}
|