fix: use golang.org/x/term instead of golang.org/x/crypto/ssh/terminal (#837)

The latter is deprecated: https://pkg.go.dev/golang.org/x/crypto/ssh/terminal
This commit is contained in:
Colin Adler
2022-04-01 21:25:46 +00:00
committed by GitHub
parent e9027b9717
commit 2a7ab08bab
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -11,10 +11,9 @@ import (
"github.com/pion/webrtc/v3"
"github.com/spf13/cobra"
gossh "golang.org/x/crypto/ssh"
"golang.org/x/term"
"golang.org/x/xerrors"
"golang.org/x/crypto/ssh/terminal"
"github.com/coder/coder/cli/cliflag"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
@@ -131,12 +130,12 @@ func ssh() *cobra.Command {
}
if isatty.IsTerminal(os.Stdout.Fd()) {
state, err := terminal.MakeRaw(int(os.Stdin.Fd()))
state, err := term.MakeRaw(int(os.Stdin.Fd()))
if err != nil {
return err
}
defer func() {
_ = terminal.Restore(int(os.Stdin.Fd()), state)
_ = term.Restore(int(os.Stdin.Fd()), state)
}()
}