From 28a0e5bd63d22340ecfaa2177a29e1c1f1b5d41c Mon Sep 17 00:00:00 2001 From: Zhou Tao Date: Wed, 22 Mar 2017 05:41:02 +0800 Subject: [PATCH] terminal: trim space in interactive console (#770) When running interactive command in gdb, it will remove beginning space, so do the same for dlv, which will be more convient for user --- pkg/terminal/terminal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/terminal/terminal.go b/pkg/terminal/terminal.go index 74a7f527..2b2164e7 100644 --- a/pkg/terminal/terminal.go +++ b/pkg/terminal/terminal.go @@ -128,7 +128,7 @@ func (t *Term) Run() (int, error) { return 1, fmt.Errorf("Prompt for input failed.\n") } - cmdstr, args := parseCommand(cmdstr) + cmdstr, args := parseCommand(strings.TrimSpace(cmdstr)) if err := t.cmds.Call(cmdstr, args, t); err != nil { if _, ok := err.(ExitRequestError); ok { return t.handleExit()