summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitsuo Heijo <25817501+johejo@users.noreply.github.com>2021-03-20 14:38:34 +0900
committerGitHub <noreply@github.com>2021-03-20 14:38:34 +0900
commit2e353aee96502556c503b0a47834aa76edf7b588 (patch)
tree76dd9ca0ef5cb27b5daf22f98bd45a8042a9584e /src
parent8edfd14a3700035d362460284fc7127b44157229 (diff)
Replace golang.org/x/crypto/ssh/terminal with golang.org/x/term (#2395)
See https://github.com/golang/go/issues/31044
Diffstat (limited to 'src')
-rw-r--r--src/tui/light.go4
-rw-r--r--src/tui/light_unix.go12
2 files changed, 8 insertions, 8 deletions
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