mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 17:56:45 +08:00
terminal: ask for confirmation when using 'quit -c' with breakpoints (#3398)
This commit is contained in:
committed by
GitHub
parent
ea13a24f38
commit
9b17415e83
@ -2876,6 +2876,20 @@ func exitCommand(t *Term, ctx callContext, args string) error {
|
||||
if !t.client.IsMulticlient() {
|
||||
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
|
||||
}
|
||||
return ExitRequestError{}
|
||||
|
||||
Reference in New Issue
Block a user