pty

package module
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 3 Imported by: 1,514

README

pty

This Go module has moved to https://github.com/creack/pty.

Existing clients will continue to work.

New clients should use the new module import path github.com/creack/pty.

Documentation

Overview

Package pty is a wrapper for github.com/creack/pty, which provides functions for working with Unix terminals.

This package is deprecated. Existing clients will continue to work, but no further updates will happen here. New clients should use github.com/creack/pty directly.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = pty.ErrUnsupported

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

Deprecated; please use github.com/creack/pty instead.

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.

Deprecated; please use github.com/creack/pty instead.

func InheritSize added in v1.1.0

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.

Deprecated; please use github.com/creack/pty instead.

func Open

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

Opens a pty and its corresponding tty.

Deprecated; please use github.com/creack/pty instead.

func Setsize added in v1.1.0

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

Setsize resizes t to s.

Deprecated; please use github.com/creack/pty instead.

func Start

func Start(c *exec.Cmd) (pty *os.File, err error)

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.

Deprecated; please use github.com/creack/pty instead.

func StartWithSize added in v1.1.3

func StartWithSize(c *exec.Cmd, sz *Winsize) (pty *os.File, err error)

StartWithSize 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.

Deprecated; please use github.com/creack/pty instead.

Types

type Winsize added in v1.1.0

type Winsize = pty.Winsize

Winsize describes the terminal size.

Deprecated; please use github.com/creack/pty instead.

func GetsizeFull added in v1.1.0

func GetsizeFull(t *os.File) (size *Winsize, err error)

GetsizeFull returns the full terminal size description.

Deprecated; please use github.com/creack/pty instead.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL