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
Provenance
- Commit
2e353ae- Tree
76dd9ca- Author
Mitsuo Heijo <25817501+johejo@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
8edfd14
4 files changed+14 added−23 removed
modified:src/tui/light_unix.go+6 added-6 removed
8 unmodified lines9 "strings"10 "syscall"11 12 "github.com/junegunn/fzf/src/util"13- "golang.org/x/crypto/ssh/terminal"13+ "golang.org/x/term"14 )15 16 func IsLightRendererSupported() bool {17 return true15 unmodified lines33 }34 35 func (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 }45 46 func (r *LightRenderer) closePlatform() {15 unmodified lines62 return in63 }64 65 func (r *LightRenderer) setupTerminal() {66- terminal.MakeRaw(r.fd())66+ term.MakeRaw(r.fd())67 }68 69 func (r *LightRenderer) restoreTerminal() {70- terminal.Restore(r.fd(), r.origState)70+ term.Restore(r.fd(), r.origState)71 }72 73 func (r *LightRenderer) updateTerminalSize() {74- width, height, err := terminal.GetSize(r.fd())74+ width, height, err := term.GetSize(r.fd())75 76 if err == nil {77 r.width = width78 r.height = r.maxHeightFunc(height)32 unmodified linesmodified:src/tui/light.go+2 added-2 removed
10 unmodified lines11 "unicode/utf8"12 13 "github.com/junegunn/fzf/src/util"14 15- "golang.org/x/crypto/ssh/terminal"15+ "golang.org/x/term"16 )17 18 const (19 defaultWidth = 8053 unmodified lines73 prevDownTime time.Time74 clickY []int75 ttyin *os.File76 buffer []byte77- origState *terminal.State77+ origState *term.State78 width int79 height int80 yoffset int81 tabstop int891 unmodified linesmodified:go.mod+2 added-2 removed
4 unmodified lines5 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 )14 15 go 1.13modified:go.sum+4 added-13 removed
11 unmodified lines12 github.com/mattn/go-shellwords v1.0.10 h1:Y7Xqm8piKOO3v10Thp7Z36h4FYFjt5xB//6XvOrs2Gw=13 github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=14 github.com/saracen/walker v0.1.1 h1:Ou2QIKTWqo0QxhtuHVmtObbmhjMCEUyJ82xp0uV+MGI=15 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=16 golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=17 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=18 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=19 golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=20 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=25 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=26 golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=27 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=28 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=