package pty
Import Path
github.com/creack/pty (on go.dev)
Dependency Relation
imports 6 packages, and imported by one package
Involved Source Files
Package pty provides functions for working with Unix terminals.
ioctl.go
ioctl_inner.go
pty_linux.go
run.go
start.go
winsize.go
winsize_unix.go
ztypes_amd64.go
Package-Level Type Names (only one)
Winsize describes the terminal size.
// ws_col: Number of columns (in cells).
// ws_row: Number of rows (in cells).
// ws_xpixel: Width in pixels.
// ws_ypixel: Height in pixels.
func GetsizeFull(t *os.File) (size *Winsize, err error)
func Setsize(t *os.File, ws *Winsize) error
func StartWithAttrs(c *exec.Cmd, sz *Winsize, attrs *syscall.SysProcAttr) (*os.File, error)
func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error)
Package-Level Functions (total 8)
Getsize returns the number of rows (lines) and cols (positions
in each line) in terminal t.
GetsizeFull returns the full terminal size description.
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.
Open a pty and its corresponding tty.
Setsize resizes t to s.
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.
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.
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.
Starts the process in a new session and sets the controlling terminal.
Package-Level Variables (only one)
ErrUnsupported is returned if a function is not
available on the current platform.
Package-Level Constants (total 2)
Local syscall const values.
Local syscall const values.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |