pty – github.com/creack/pty Index | Files

package pty

import "github.com/creack/pty"

Package pty provides functions for working with Unix terminals.

Index

Variables

var ErrUnsupported = errors.New("unsupported")

ErrUnsupported is returned if a function is not available on the current platform.

Functions

func Getsize

func Getsize(t *os.File) (rows, cols int, err error)

Getsize returns the number of rows (lines) and cols (positions in each line) in terminal t.

func InheritSize

func InheritSize(pty, tty *os.File) error

InheritSize applies the terminal size of pty to tty. This should be run in a signal handler for syscall.SIGWINCH to automatically resize the tty when the pty receives a window size change notification.

func Open

func Open() (pty, tty *os.File, err error)

Open a pty and its corresponding tty.

func Setsize

func Setsize(*os.File, *Winsize) error

Setsize resizes t to s.

Types

type Winsize

type Winsize struct {
	Rows, Cols, X, Y uint
}

Winsize is a dummy struct to enable compilation on unsupported platforms.

func GetsizeFull

func GetsizeFull(*os.File) (*Winsize, error)

GetsizeFull returns the full terminal size description.

Source Files

doc.go pty_unsupported.go winsize.go winsize_unsupported.go ztypes_amd64.go

Version
v1.1.15
Published
Aug 21, 2021
Platform
windows/amd64
Imports
2 packages
Last checked
2 minutes ago

Tools for package owners.