Skip to content

Commit

Permalink
connect: fix work with terminal
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LeonidVas committed Apr 19, 2022
1 parent dd26bc6 commit df7f722
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/connect/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
Expand Down Expand Up @@ -128,6 +129,11 @@ func (console *Console) Run() error {

console.prompt.Run()

// Sets the terminal modes to “sane” values to workaround
// bug https://github.com/c-bata/go-prompt/issues/228
reinitialization := exec.Command("reset")
_ = reinitialization.Run()

return nil
}

Expand Down

0 comments on commit df7f722

Please sign in to comment.