Merge pull request #3530 from tklauser/x-term

Use golang.org/x/term
This commit is contained in:
Mislav Marohnić 2021-04-30 11:57:01 +02:00 committed by GitHub
commit d478a65254
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)
}