mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			301 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			301 B
		
	
	
	
		
			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.Em.Emit("signal.sigint")
 | |
| 			if !running && interactive {
 | |
| 				lr.ClearInput()
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| }
 |