diff --git a/go.mod b/go.mod index 9bcaa63d..2ae23dcf 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,6 @@ require ( github.com/sirupsen/logrus v1.3.0 github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad github.com/stretchr/testify v1.2.2 - golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522 google.golang.org/grpc v1.22.0 // indirect diff --git a/pkg/commands/container.go b/pkg/commands/container.go index 5922ba77..f0a9f8e1 100644 --- a/pkg/commands/container.go +++ b/pkg/commands/container.go @@ -4,7 +4,6 @@ import ( "context" "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/term" - "golang.org/x/crypto/ssh/terminal" "io" "os" @@ -372,8 +371,8 @@ func (c *Container) Attach() error { return err } - fd := int(os.Stdin.Fd()) - oldState, err := terminal.MakeRaw(fd) + fd := os.Stdin.Fd() + oldState, err := term.MakeRaw(fd) if err != nil { return err } @@ -412,7 +411,7 @@ func (c *Container) Attach() error { return err } } else { - err = terminal.Restore(fd, oldState) + err = term.RestoreTerminal(fd, oldState) if err != nil { return err } @@ -423,15 +422,15 @@ func (c *Container) Attach() error { } } -func (c *Container) Resize(fd int) error { - width, height, err := terminal.GetSize(fd) +func (c *Container) Resize(fd uintptr) error { + size, err := term.GetWinsize(fd) if err != nil { return err } options := types.ResizeOptions{ - Height: uint(height), - Width: uint(width), + Height: uint(size.Height), + Width: uint(size.Width), } err = c.Client.ContainerResize(context.Background(), c.ID, options)