Skip to content

Commit acec1f3

Browse files
committed
connect: fix work with terminal
The patch adds a workaround for the bug "Terminal does not display command after go-prompt exit" (c-bata/go-prompt#228). Part of #15
1 parent cdd3c14 commit acec1f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/connect/console.go

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"io"
77
"os"
8+
"os/exec"
89
"path/filepath"
910
"sort"
1011
"strings"
@@ -128,6 +129,12 @@ func (console *Console) Run() error {
128129

129130
console.prompt.Run()
130131

132+
// Sets the terminal modes to “sane” values to workaround
133+
// bug https://github.com/c-bata/go-prompt/issues/228
134+
sttySane := exec.Command("stty", "sane")
135+
sttySane.Stdin = os.Stdin
136+
_ = sttySane.Run()
137+
131138
return nil
132139
}
133140

0 commit comments

Comments
 (0)