From 31658f37dc6e9ccbee43cc871e82e4eaedf8279f Mon Sep 17 00:00:00 2001 From: "Seth W. Klein" Date: Thu, 7 May 2015 01:40:44 -0400 Subject: [PATCH] Add default answer hint to kill process prompt Also supports capitalized answers. --- terminal/terminal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminal/terminal.go b/terminal/terminal.go index db2b5470..a927bba8 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -132,11 +132,11 @@ 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 { return io.EOF, 2 } - answer = strings.TrimSuffix(answer, "\n") + answer = strings.ToLower(strings.TrimSpace(answer)) kill := (answer == "y") err = client.Detach(kill)