Documentation
¶
Overview ¶
Package pty provides pseudo-terminal support for the terminal widget.
Portions of this package are adapted from github.com/creack/pty.
Index ¶
- Constants
- Variables
- func Open() (pty, tty *os.File, err error)
- func Setsize(t *os.File, ws *Winsize) error
- func Start(cmd *exec.Cmd) (*os.File, error)
- func StartWithAttrs(c *exec.Cmd, sz *Winsize, attrs *syscall.SysProcAttr) (*os.File, error)
- func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error)
- type Winsize
Constants ¶
const ( TIOCGWINSZ = syscall.TIOCGWINSZ TIOCSWINSZ = syscall.TIOCSWINSZ )
Variables ¶
var ErrUnsupported = errors.New("unsupported")
ErrUnsupported is returned if a function is not available on the current platform.
Functions ¶
func Start ¶
Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, and c.Stderr, calls c.Start, and returns the File of the tty's corresponding pty.
Starts the process in a new session and sets the controlling terminal.
func StartWithAttrs ¶
StartWithAttrs assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, and c.Stderr, calls c.Start, and returns the File of the tty's corresponding pty.
This will resize the pty to the specified size before starting the command if a size is provided. The `attrs` parameter overrides the one set in c.SysProcAttr.
This should generally not be needed. Used in some edge cases where it is needed to create a pty without a controlling terminal.