From 51a9aa71c6e5efab67e2abca08ea99704e8c914c Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Wed, 29 Apr 2015 23:21:27 -0500 Subject: [PATCH] Fix: Exit on EOF --- terminal/terminal.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/terminal/terminal.go b/terminal/terminal.go index f628a8cf..7a6fc4c6 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -72,10 +72,6 @@ func (t *Term) Run() (error, int) { for { cmdstr, err := t.promptForInput() - if len(cmdstr) == 0 { - continue - } - if err != nil { if err == io.EOF { err, status = handleExit(t.client, t) @@ -83,6 +79,9 @@ func (t *Term) Run() (error, int) { err, status = fmt.Errorf("Prompt for input failed.\n"), 1 break } + if len(cmdstr) == 0 { + continue + } cmdstr, args := parseCommand(cmdstr)