Use golang.org/x/term

The golang.org/x/crypto/ssh/terminal package is deprecated and merely a
wrapper around golang.org/x/term. Use the latter directly and avoid the
dependency on the former altogether.
This commit is contained in:
Tobias Klauser
2021-04-29 14:24:25 +02:00
committed by Christian Muehlhaeuser
parent b9e853eb2d
commit 295f7bd246
6 changed files with 17 additions and 27 deletions

View File

@@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)
// listenForResize sends messages (or errors) when the terminal resizes.
@@ -18,7 +18,7 @@ func listenForResize(output *os.File, msgs chan Msg, errs chan error) {
signal.Notify(sig, syscall.SIGWINCH)
for {
<-sig
w, h, err := terminal.GetSize(int(output.Fd()))
w, h, err := term.GetSize(int(output.Fd()))
if err != nil {
errs <- err
}