From 2e353aee96502556c503b0a47834aa76edf7b588 Mon Sep 17 00:00:00 2001 From: Mitsuo Heijo <25817501+johejo@users.noreply.github.com> Date: Sat, 20 Mar 2021 14:38:34 +0900 Subject: Replace golang.org/x/crypto/ssh/terminal with golang.org/x/term (#2395) See https://github.com/golang/go/issues/31044 --- src/tui/light.go | 4 ++-- src/tui/light_unix.go | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/tui') diff --git a/src/tui/light.go b/src/tui/light.go index a1234166..8f83c171 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -12,7 +12,7 @@ import ( "github.com/junegunn/fzf/src/util" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) const ( @@ -74,7 +74,7 @@ type LightRenderer struct { clickY []int ttyin *os.File buffer []byte - origState *terminal.State + origState *term.State width int height int yoffset int diff --git a/src/tui/light_unix.go b/src/tui/light_unix.go index 18788702..936a13e3 100644 --- a/src/tui/light_unix.go +++ b/src/tui/light_unix.go @@ -10,7 +10,7 @@ import ( "syscall" "github.com/junegunn/fzf/src/util" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) func IsLightRendererSupported() bool { @@ -34,12 +34,12 @@ func (r *LightRenderer) fd() int { func (r *LightRenderer) initPlatform() error { fd := r.fd() - origState, err := terminal.GetState(fd) + origState, err := term.GetState(fd) if err != nil { return err } r.origState = origState - terminal.MakeRaw(fd) + term.MakeRaw(fd) return nil } @@ -63,15 +63,15 @@ func openTtyIn() *os.File { } func (r *LightRenderer) setupTerminal() { - terminal.MakeRaw(r.fd()) + term.MakeRaw(r.fd()) } func (r *LightRenderer) restoreTerminal() { - terminal.Restore(r.fd(), r.origState) + term.Restore(r.fd(), r.origState) } func (r *LightRenderer) updateTerminalSize() { - width, height, err := terminal.GetSize(r.fd()) + width, height, err := term.GetSize(r.fd()) if err == nil { r.width = width -- cgit v1.2.3