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
This commit is contained in:
Zhou Tao 2017-03-22 05:41:02 +08:00 committed by Derek Parker
parent ab7367ed2b
commit 28a0e5bd63

@ -128,7 +128,7 @@ func (t *Term) Run() (int, error) {
return 1, fmt.Errorf("Prompt for input failed.\n") 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 err := t.cmds.Call(cmdstr, args, t); err != nil {
if _, ok := err.(ExitRequestError); ok { if _, ok := err.(ExitRequestError); ok {
return t.handleExit() return t.handleExit()