Skip to content
Snippets Groups Projects
Commit c48e05e6 authored by Arran Walker's avatar Arran Walker
Browse files

Migrate from docker/pkg/term to golang.org/x/term

parent 656dbc17
No related branches found
No related tags found
No related merge requests found
...@@ -11,11 +11,11 @@ import ( ...@@ -11,11 +11,11 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/docker/docker/pkg/term"
"github.com/docker/machine/libmachine/log" "github.com/docker/machine/libmachine/log"
"github.com/docker/machine/libmachine/mcnutils" "github.com/docker/machine/libmachine/mcnutils"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
) )
type Client interface { type Client interface {
...@@ -293,7 +293,7 @@ func (client *NativeClient) Shell(args ...string) error { ...@@ -293,7 +293,7 @@ func (client *NativeClient) Shell(args ...string) error {
ssh.ECHO: 1, ssh.ECHO: 1,
} }
fd := os.Stdin.Fd() fd := int(os.Stdin.Fd())
if term.IsTerminal(fd) { if term.IsTerminal(fd) {
oldState, err := term.MakeRaw(fd) oldState, err := term.MakeRaw(fd)
...@@ -301,15 +301,15 @@ func (client *NativeClient) Shell(args ...string) error { ...@@ -301,15 +301,15 @@ func (client *NativeClient) Shell(args ...string) error {
return err return err
} }
defer term.RestoreTerminal(fd, oldState) defer term.Restore(fd, oldState)
winsize, err := term.GetWinsize(fd) width, height, err := term.GetSize(fd)
if err != nil { if err != nil {
termWidth = 80 termWidth = 80
termHeight = 24 termHeight = 24
} else { } else {
termWidth = int(winsize.Width) termWidth = width
termHeight = int(winsize.Height) termHeight = height
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment