Use golang.org/x/term

The golang.org/x/crypto/ssh/terminal package is deprecated and merely a
wrapper around golang.org/x/term. Use the latter directly.
This commit is contained in:
Tobias Klauser 2021-04-28 18:44:36 +02:00
parent 9436990e18
commit b586d51778
4 changed files with 7 additions and 4 deletions

View file

@ -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)
}