Skip to content

Commit 6ef996f

Browse files
committed
replace golang.org/x/crypto/ssh/terminal with golang.org/x/term
See golang/go#31044
1 parent 1a191ec commit 6ef996f

File tree

4 files changed

+14
-23
lines changed

4 files changed

+14
-23
lines changed

Diff for: go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ require (
66
github.com/mattn/go-runewidth v0.0.9
77
github.com/mattn/go-shellwords v1.0.10
88
github.com/saracen/walker v0.1.1
9-
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
109
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 // indirect
11-
golang.org/x/sys v0.0.0-20201026173827-119d4633e4d1
10+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68
11+
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6
1212
golang.org/x/text v0.3.3 // indirect
1313
)
1414

Diff for: go.sum

+4-13
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,16 @@ github.com/mattn/go-shellwords v1.0.10 h1:Y7Xqm8piKOO3v10Thp7Z36h4FYFjt5xB//6XvO
1313
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
1414
github.com/saracen/walker v0.1.1 h1:Ou2QIKTWqo0QxhtuHVmtObbmhjMCEUyJ82xp0uV+MGI=
1515
github.com/saracen/walker v0.1.1/go.mod h1:0oKYMsKVhSJ+ful4p/XbjvXbMgLEkLITZaxozsl4CGE=
16-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
17-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
18-
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
19-
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
20-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
21-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
2216
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
2317
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
2418
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
25-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
26-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
27-
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 h1:9nuHUbU8dRnRRfj9KjWUVrJeoexdbeMjttk6Oh1rD10=
2819
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2920
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
30-
golang.org/x/sys v0.0.0-20201026173827-119d4633e4d1 h1:/DtoiOYKoQCcIFXQjz07RnWNPRCbqmSXSpgEzhC9ZHM=
31-
golang.org/x/sys v0.0.0-20201026173827-119d4633e4d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
32-
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
21+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
22+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
23+
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 h1:EC6+IGYTjPpRfv9a2b/6Puw0W+hLtAhkV1tPsXhutqs=
24+
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
3325
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
3426
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
3527
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
36-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e h1:FDhOuMEY4JVRztM/gsbk+IKUQ8kj74bxZrgw87eMMVc=
3728
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

Diff for: src/tui/light.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/junegunn/fzf/src/util"
1414

15-
"golang.org/x/crypto/ssh/terminal"
15+
"golang.org/x/term"
1616
)
1717

1818
const (
@@ -74,7 +74,7 @@ type LightRenderer struct {
7474
clickY []int
7575
ttyin *os.File
7676
buffer []byte
77-
origState *terminal.State
77+
origState *term.State
7878
width int
7979
height int
8080
yoffset int

Diff for: src/tui/light_unix.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"syscall"
1111

1212
"github.com/junegunn/fzf/src/util"
13-
"golang.org/x/crypto/ssh/terminal"
13+
"golang.org/x/term"
1414
)
1515

1616
func IsLightRendererSupported() bool {
@@ -34,12 +34,12 @@ func (r *LightRenderer) fd() int {
3434

3535
func (r *LightRenderer) initPlatform() error {
3636
fd := r.fd()
37-
origState, err := terminal.GetState(fd)
37+
origState, err := term.GetState(fd)
3838
if err != nil {
3939
return err
4040
}
4141
r.origState = origState
42-
terminal.MakeRaw(fd)
42+
term.MakeRaw(fd)
4343
return nil
4444
}
4545

@@ -63,15 +63,15 @@ func openTtyIn() *os.File {
6363
}
6464

6565
func (r *LightRenderer) setupTerminal() {
66-
terminal.MakeRaw(r.fd())
66+
term.MakeRaw(r.fd())
6767
}
6868

6969
func (r *LightRenderer) restoreTerminal() {
70-
terminal.Restore(r.fd(), r.origState)
70+
term.Restore(r.fd(), r.origState)
7171
}
7272

7373
func (r *LightRenderer) updateTerminalSize() {
74-
width, height, err := terminal.GetSize(r.fd())
74+
width, height, err := term.GetSize(r.fd())
7575

7676
if err == nil {
7777
r.width = width

0 commit comments

Comments
 (0)