terminal fix hack
This commit is contained in:
		
							parent
							
								
									1e45d360b4
								
							
						
					
					
						commit
						5f4bad3634
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		
							
								
								
									
										4
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								main.go
									
										
									
									
									
								
							| 
						 | 
					@ -148,11 +148,15 @@ func main() {
 | 
				
			||||||
  keyboard.Listen(func(key keys.Key) (stop bool, err error) {
 | 
					  keyboard.Listen(func(key keys.Key) (stop bool, err error) {
 | 
				
			||||||
    if !state.IsInPrompt() {
 | 
					    if !state.IsInPrompt() {
 | 
				
			||||||
      if key.Code == keys.CtrlC {
 | 
					      if key.Code == keys.CtrlC {
 | 
				
			||||||
 | 
					        term.Restore(int(os.Stdin.Fd()), oldState)
 | 
				
			||||||
        commands.QuitCommand()
 | 
					        commands.QuitCommand()
 | 
				
			||||||
        return true, nil
 | 
					        return true, nil
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        command, has := commands.GetCommand(key.String())
 | 
					        command, has := commands.GetCommand(key.String())
 | 
				
			||||||
        if has {
 | 
					        if has {
 | 
				
			||||||
 | 
					          if key.String() == "q" {
 | 
				
			||||||
 | 
					            term.Restore(int(os.Stdin.Fd()), oldState)
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
          command.Run()
 | 
					          command.Run()
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          commands.SendMode()
 | 
					          commands.SendMode()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue