diff --git a/go.mod b/go.mod index 3b8e4be04..b44012c93 100644 --- a/go.mod +++ b/go.mod @@ -33,6 +33,7 @@ require ( golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 + golang.org/x/term v0.0.0-20210422114643-f5beecf764ed golang.org/x/text v0.3.4 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) diff --git a/go.sum b/go.sum index 18a545ed4..523a32a85 100644 --- a/go.sum +++ b/go.sum @@ -357,6 +357,8 @@ golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/BESIg2ze4Pgfh/aI8c= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210422114643-f5beecf764ed h1:Ei4bQjjpYUsS4efOUz+5Nz++IVkHk87n2zBA0NxBWc0= +golang.org/x/term v0.0.0-20210422114643-f5beecf764ed/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/pkg/iostreams/iostreams.go b/pkg/iostreams/iostreams.go index da57cac80..d6717ca8a 100644 --- a/pkg/iostreams/iostreams.go +++ b/pkg/iostreams/iostreams.go @@ -17,7 +17,7 @@ import ( "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" "github.com/muesli/termenv" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) type IOStreams struct { @@ -332,7 +332,7 @@ func isCygwinTerminal(w io.Writer) bool { func terminalSize(w io.Writer) (int, int, error) { if f, isFile := w.(*os.File); isFile { - return terminal.GetSize(int(f.Fd())) + return term.GetSize(int(f.Fd())) } return 0, 0, fmt.Errorf("%v is not a file", w) } diff --git a/utils/terminal.go b/utils/terminal.go index eea5c3f61..e97c8f12c 100644 --- a/utils/terminal.go +++ b/utils/terminal.go @@ -5,7 +5,7 @@ import ( "os" "github.com/mattn/go-isatty" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) var IsTerminal = func(f *os.File) bool { @@ -18,7 +18,7 @@ func IsCygwinTerminal(f *os.File) bool { var TerminalSize = func(w interface{}) (int, int, error) { if f, isFile := w.(*os.File); isFile { - return terminal.GetSize(int(f.Fd())) + return term.GetSize(int(f.Fd())) } return 0, 0, fmt.Errorf("%v is not a file", w)