gum/spin/pty.go
Carlos Alexandro Becker 817c4bd446
fix: lint issues (#909)
* fix: some of the lint issues

* fix: staticcheck
2025-05-30 10:34:31 -03:00

22 lines
374 B
Go

package spin
import (
"os"
"github.com/charmbracelet/x/term"
"github.com/charmbracelet/x/xpty"
)
func openPty(f *os.File) (pty xpty.Pty, err error) {
width, height, err := term.GetSize(f.Fd())
if err != nil {
return nil, err //nolint:wrapcheck
}
pty, err = xpty.NewPty(width, height)
if err != nil {
return nil, err //nolint:wrapcheck
}
return pty, nil
}