mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 02:07:58 +08:00
Default to killing process on exit
Also adds support for capitalization variants of "no" to not kill process.
This commit is contained in:
@ -132,13 +132,13 @@ func handleExit(client service.Client, t *Term) (error, int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
answer, err := t.line.Prompt("Would you like to kill the process? [y/N] ")
|
answer, err := t.line.Prompt("Would you like to kill the process? [Y/n] ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return io.EOF, 2
|
return io.EOF, 2
|
||||||
}
|
}
|
||||||
answer = strings.ToLower(strings.TrimSpace(answer))
|
answer = strings.ToLower(strings.TrimSpace(answer))
|
||||||
|
|
||||||
kill := (answer == "y")
|
kill := (answer != "n" && answer != "no")
|
||||||
err = client.Detach(kill)
|
err = client.Detach(kill)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err, 1
|
return err, 1
|
||||||
|
|||||||
Reference in New Issue
Block a user