Skip to content
Myr

Replace golang.org/x/crypto/ssh/terminal with golang.org/x/term (#2395)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

See https://github.com/golang/go/issues/31044

authored by Mitsuo Heijo · committed by GitHub · parent 8edfd14 · Browse files · 4 files+14 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+14 added−23 removed

  • other:+14 added−23 removed

4 files+14 added−23 removed

modified:src/tui/light_unix.go+6 added-6 removed
8 unmodified lines
9 "strings"10 "syscall"1112 "github.com/junegunn/fzf/src/util"13 "golang.org/x/crypto/ssh/terminal"13 "golang.org/x/term"14)1516func IsLightRendererSupported() bool {17 return true
15 unmodified lines
33}3435func (r *LightRenderer) initPlatform() error {36 fd := r.fd()37 origState, err := terminal.GetState(fd)37 origState, err := term.GetState(fd)38 if err != nil {39 return err40 }41 r.origState = origState42 terminal.MakeRaw(fd)42 term.MakeRaw(fd)43 return nil44}4546func (r *LightRenderer) closePlatform() {
15 unmodified lines
62 return in63}6465func (r *LightRenderer) setupTerminal() {66 terminal.MakeRaw(r.fd())66 term.MakeRaw(r.fd())67}6869func (r *LightRenderer) restoreTerminal() {70 terminal.Restore(r.fd(), r.origState)70 term.Restore(r.fd(), r.origState)71}7273func (r *LightRenderer) updateTerminalSize() {74 width, height, err := terminal.GetSize(r.fd())74 width, height, err := term.GetSize(r.fd())7576 if err == nil {77 r.width = width78 r.height = r.maxHeightFunc(height)
32 unmodified lines
modified:src/tui/light.go+2 added-2 removed
10 unmodified lines
11 "unicode/utf8"1213 "github.com/junegunn/fzf/src/util"1415 "golang.org/x/crypto/ssh/terminal"15 "golang.org/x/term"16)1718const (19 defaultWidth = 80
53 unmodified lines
73 prevDownTime time.Time74 clickY []int75 ttyin *os.File76 buffer []byte77 origState *terminal.State77 origState *term.State78 width int79 height int80 yoffset int81 tabstop int
891 unmodified lines
modified:go.mod+2 added-2 removed
4 unmodified lines
5 github.com/mattn/go-isatty v0.0.126 github.com/mattn/go-runewidth v0.0.97 github.com/mattn/go-shellwords v1.0.108 github.com/saracen/walker v0.1.19 golang.org/x/crypto v0.0.0-20201016220609-9e8e0b3908979 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 // indirect11 golang.org/x/sys v0.0.0-20201026173827-119d4633e4d110 golang.org/x/sys v0.0.0-20201119102817-f84b799fce6811 golang.org/x/term v0.0.0-20210317153231-de623e64d2a612 golang.org/x/text v0.3.3 // indirect13)1415go 1.13
modified:go.sum+4 added-13 removed
11 unmodified lines
12github.com/mattn/go-shellwords v1.0.10 h1:Y7Xqm8piKOO3v10Thp7Z36h4FYFjt5xB//6XvOrs2Gw=13github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=14github.com/saracen/walker v0.1.1 h1:Ou2QIKTWqo0QxhtuHVmtObbmhjMCEUyJ82xp0uV+MGI=15github.com/saracen/walker v0.1.1/go.mod h1:0oKYMsKVhSJ+ful4p/XbjvXbMgLEkLITZaxozsl4CGE=16golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=17golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=18golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=19golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=20golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=21golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=16golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=17golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=18golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=25golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=26golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=27golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 h1:9nuHUbU8dRnRRfj9KjWUVrJeoexdbeMjttk6Oh1rD10=19golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=20golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=30golang.org/x/sys v0.0.0-20201026173827-119d4633e4d1 h1:/DtoiOYKoQCcIFXQjz07RnWNPRCbqmSXSpgEzhC9ZHM=31golang.org/x/sys v0.0.0-20201026173827-119d4633e4d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=32golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=21golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=22golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=23golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 h1:EC6+IGYTjPpRfv9a2b/6Puw0W+hLtAhkV1tPsXhutqs=24golang.org/x/term v0.0.0-20210317153231-de623e64d2a6/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=25golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=26golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=27golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=36golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e h1:FDhOuMEY4JVRztM/gsbk+IKUQ8kj74bxZrgw87eMMVc=28golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=