From 3ca1dd35cac94cc8be851eebfa5365075d53826e Mon Sep 17 00:00:00 2001 From: aarzilli Date: Tue, 2 Feb 2016 12:48:54 +0100 Subject: [PATCH] cmd/dlv: bugfix: trace disables terminal echo Fixes #397 --- cmd/dlv/main.go | 4 +++- terminal/terminal.go | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/dlv/main.go b/cmd/dlv/main.go index 82bd7417..2fd0b523 100644 --- a/cmd/dlv/main.go +++ b/cmd/dlv/main.go @@ -256,7 +256,9 @@ func traceCmd(cmd *cobra.Command, args []string) { } cmds := terminal.DebugCommands(client) cmd := cmds.Find("continue") - err = cmd(terminal.New(client, nil), "") + t := terminal.New(client, nil) + defer t.Close() + err = cmd(t, "") if err != nil { fmt.Fprintln(os.Stderr, err) return 1 diff --git a/terminal/terminal.go b/terminal/terminal.go index 302161e5..4bed2710 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -41,9 +41,13 @@ func New(client service.Client, conf *config.Config) *Term { } } +func (t *Term) Close() { + t.line.Close() +} + // Run begins running dlv in the terminal. func (t *Term) Run() (int, error) { - defer t.line.Close() + defer t.Close() // Send the debugger a halt command on SIGINT ch := make(chan os.Signal) -- GitLab