mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 10:47:27 +08:00 
			
		
		
		
	terminal: ask for confirmation when using 'quit -c' with breakpoints (#3398)
This commit is contained in:
		 Alessandro Arzilli
					Alessandro Arzilli
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							ea13a24f38
						
					
				
				
					commit
					9b17415e83
				
			| @ -2876,6 +2876,20 @@ func exitCommand(t *Term, ctx callContext, args string) error { | |||||||
| 		if !t.client.IsMulticlient() { | 		if !t.client.IsMulticlient() { | ||||||
| 			return errors.New("not connected to an --accept-multiclient server") | 			return errors.New("not connected to an --accept-multiclient server") | ||||||
| 		} | 		} | ||||||
|  | 		bps, _ := t.client.ListBreakpoints(false) | ||||||
|  | 		hasUserBreakpoints := false | ||||||
|  | 		for _, bp := range bps { | ||||||
|  | 			if bp.ID >= 0 { | ||||||
|  | 				hasUserBreakpoints = true | ||||||
|  | 				break | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		if hasUserBreakpoints { | ||||||
|  | 			yes, _ := yesno(t.line, "There are breakpoints set, do you wish to quit and continue without clearing breakpoints? [Y/n] ", "yes") | ||||||
|  | 			if !yes { | ||||||
|  | 				return nil | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 		t.quitContinue = true | 		t.quitContinue = true | ||||||
| 	} | 	} | ||||||
| 	return ExitRequestError{} | 	return ExitRequestError{} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user