package pty
import "github.com/creack/pty"
Package pty provides functions for working with Unix terminals.
Index ¶
- Variables
- func Getsize(t *os.File) (rows, cols int, err error)
- func InheritSize(master, slave *os.File) error
- func Open() (pty, tty *os.File, err error)
- func Setsize(t *os.File, ws *Winsize) error
- func Start(c *exec.Cmd) (pty *os.File, err error)
- type Winsize
Variables ¶
ErrUnsupported is returned if a function is not available on the current platform.
Functions ¶
func Getsize ¶
Getsize returns the number of rows (lines) and cols (positions in each line) in terminal t.
func InheritSize ¶
InheritSize applies the terminal size of master to slave. This should be run in a signal handler for syscall.SIGWINCH to automatically resize the slave when the master receives a window size change notification.
func Open ¶
Opens a pty and its corresponding tty.
func Setsize ¶
Setsize resizes t to s.
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.
Types ¶
type Winsize ¶
type Winsize struct { Rows uint16 // ws_row: Number of rows (in cells) Cols uint16 // ws_col: Number of columns (in cells) X uint16 // ws_xpixel: Width in pixels Y uint16 // ws_ypixel: Height in pixels }
Winsize describes the terminal size.
func GetsizeFull ¶
GetsizeFull returns the full terminal size description.
Source Files ¶
doc.go ioctl.go pty_linux.go run.go util.go ztypes_amd64.go
- Version
- v1.1.1
- Published
- Jan 13, 2018
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- now –
Tools for package owners.