Skip to content

Commit

Permalink
cli: rollback x/crypto/ssh/terminal->x/term
Browse files Browse the repository at this point in the history
  • Loading branch information
anpep committed Jun 29, 2023
1 parent bc316ad commit 6a34f53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internals/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/canonical/go-flags"

"golang.org/x/term"
"golang.org/x/crypto/ssh/terminal"

"github.com/canonical/pebble/client"
"github.com/canonical/pebble/internals/logger"
Expand All @@ -39,7 +39,7 @@ var (
Stdout io.Writer = os.Stdout
Stderr io.Writer = os.Stderr
// overridden for testing
ReadPassword = term.ReadPassword
ReadPassword = terminal.ReadPassword
// set to logger.Panicf in testing
noticef = logger.Noticef
)
Expand Down Expand Up @@ -255,8 +255,8 @@ func Parser(cli *client.Client) *flags.Parser {
}

var (
isStdinTTY = term.IsTerminal(0)
isStdoutTTY = term.IsTerminal(1)
isStdinTTY = terminal.IsTerminal(0)
isStdoutTTY = terminal.IsTerminal(1)
osExit = os.Exit
)

Expand Down
4 changes: 2 additions & 2 deletions internals/cli/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"unicode"
"unicode/utf8"

"golang.org/x/term"
"golang.org/x/crypto/ssh/terminal"
)

type unicodeMixin struct {
Expand Down Expand Up @@ -150,7 +150,7 @@ var termSize = termSizeImpl

func termSizeImpl() (width, height int) {
if f, ok := Stdout.(*os.File); ok {
width, height, _ = term.GetSize(int(f.Fd()))
width, height, _ = terminal.GetSize(int(f.Fd()))
}

if width <= 0 {
Expand Down

0 comments on commit 6a34f53

Please sign in to comment.