pty.go
This file
Path
spin/pty.go
22 lines · 374 bytes · Go
Last changed by
fix: lint issues (#909)Carlos Alexandro Beckerbefore adoption817c4bd
History of this fileTake it
fix(spin): preserve color output when `--show-output` is given (#850)Andrey Neringbefore adoption93f6857
lines 1–12why, one step back1package spin23import (4 "os"56 "github.com/charmbracelet/x/term"7 "github.com/charmbracelet/x/xpty"8)910func openPty(f *os.File) (pty xpty.Pty, err error) {11 width, height, err := term.GetSize(f.Fd())12 if err != nil {fix: lint issues (#909)Carlos Alexandro Beckerbefore adoption817c4bd
line 13why, one step back13 return nil, err //nolint:wrapcheckfix(spin): preserve color output when `--show-output` is given (#850)Andrey Neringbefore adoption93f6857
lines 14–17why, one step back14 }1516 pty, err = xpty.NewPty(width, height)17 if err != nil {fix: lint issues (#909)Carlos Alexandro Beckerbefore adoption817c4bd
line 18why, one step back18 return nil, err //nolint:wrapcheckfix(spin): preserve color output when `--show-output` is given (#850)Andrey Neringbefore adoption93f6857
lines 19–22why, one step back19 }2021 return pty, nil22}