term

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

Pair represents a pair of pty and tty

func (*Pair) Close

func (p *Pair) Close()

Close restores the input modes of each terminal and then calls close. When p is not initialized, does nothing.

func (*Pair) External

func (p *Pair) External() *os.File

External returns an os.File pointing to the master terminal. This is the terminal that should be used for communication.

func (*Pair) Handle

func (p *Pair) Handle(events <-chan Size)

Handle is HandleWith(events, nil).

func (*Pair) HandleWith

func (p *Pair) HandleWith(events <-chan Size, effect func(event Size))

HandleWith instructs this Pair to resize according to events in this channel. Whenever a resize occurs, the effect function is called except when it is nil.

func (*Pair) Internal

func (p *Pair) Internal() *os.File

Internal returns an os.File pointing to the slave terminal. This is the terminal that internal programs should run on.

func (*Pair) Open

func (p *Pair) Open(rawMode bool) error

Open creates a new Pair of pty and tty

func (*Pair) RawMode

func (p *Pair) RawMode()

RawMode places the inputs of this terminal into raw mode.

func (*Pair) RestoreMode

func (p *Pair) RestoreMode()

RestoreMode restores the input modes of this terminal.

func (*Pair) UnhangHack

func (p *Pair) UnhangHack()

UnhangHack will attempt to emulate a user exit on the underlying terminal. This is to unblock any potentially stuck "Read()" call to it.

func (*Pair) Use

func (p *Pair) Use(pty *os.File)

Use instructs this Terminal pair to make use of pty

type Pipes

type Pipes struct {
	StdoutPipe, StderrPipe *os.File
	StdinPipe              *os.File
	// contains filtered or unexported fields
}

Pipes can be used by a Process to implement piped input / output

func (*Pipes) ClosePipes

func (p *Pipes) ClosePipes()

ClosePipes closes all pipes (if any)

func (*Pipes) Stderr

func (p *Pipes) Stderr() (stderr io.ReadCloser, err error)

Stderr returns a pipe to Stderr

func (*Pipes) Stdin

func (p *Pipes) Stdin() (stdin io.WriteCloser, err error)

Stdin returns a pipe to Stdin

func (*Pipes) Stdout

func (p *Pipes) Stdout() (stdout io.ReadCloser, err error)

Stdout returns a pipe to Stdout

type Size

type Size struct {
	Width, Height uint16
}

Size indicates the size of a terminal

Jump to

Keyboard shortcuts

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