mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	fix: custom handle ctrl c from readline
This commit is contained in:
		
							parent
							
								
									d355d02b93
								
							
						
					
					
						commit
						36cd4d4123
					
				
							
								
								
									
										5
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.go
									
									
									
									
									
								
							@ -14,6 +14,7 @@ import (
 | 
			
		||||
 | 
			
		||||
	"github.com/pborman/getopt"
 | 
			
		||||
	"github.com/yuin/gopher-lua"
 | 
			
		||||
	"github.com/maxlandon/readline"
 | 
			
		||||
	"golang.org/x/term"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -174,9 +175,13 @@ input:
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			if err != readline.CtrlC {
 | 
			
		||||
				// If we get a completely random error, print
 | 
			
		||||
				fmt.Fprintln(os.Stderr, err)
 | 
			
		||||
			}
 | 
			
		||||
			fmt.Println("^C")
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		oldInput := input
 | 
			
		||||
 | 
			
		||||
		input = strings.TrimSpace(input)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user