Skip to content

Commit 2a7ab08

Browse files
authored
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
1 parent e9027b9 commit 2a7ab08

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cli/ssh.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import (
1111
"github.com/pion/webrtc/v3"
1212
"github.com/spf13/cobra"
1313
gossh "golang.org/x/crypto/ssh"
14+
"golang.org/x/term"
1415
"golang.org/x/xerrors"
1516

16-
"golang.org/x/crypto/ssh/terminal"
17-
1817
"github.com/coder/coder/cli/cliflag"
1918
"github.com/coder/coder/cli/cliui"
2019
"github.com/coder/coder/coderd/database"
@@ -131,12 +130,12 @@ func ssh() *cobra.Command {
131130
}
132131

133132
if isatty.IsTerminal(os.Stdout.Fd()) {
134-
state, err := terminal.MakeRaw(int(os.Stdin.Fd()))
133+
state, err := term.MakeRaw(int(os.Stdin.Fd()))
135134
if err != nil {
136135
return err
137136
}
138137
defer func() {
139-
_ = terminal.Restore(int(os.Stdin.Fd()), state)
138+
_ = term.Restore(int(os.Stdin.Fd()), state)
140139
}()
141140
}
142141

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ require (
236236
go.opencensus.io v0.23.0 // indirect
237237
golang.org/x/mod v0.5.1 // indirect
238238
golang.org/x/net v0.0.0-20220325170049-de3da57026de // indirect
239-
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
239+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
240240
golang.org/x/text v0.3.7 // indirect
241241
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
242242
golang.org/x/tools v0.1.9 // indirect

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy