mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
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:
committed by
Christian Muehlhaeuser
parent
b9e853eb2d
commit
295f7bd246
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user