conpty

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pty

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

Pty is a wrapper around a Windows PseudoConsole handle. Create a new instance by calling `Create()`.

func Create

func Create(width, height int16, flags uint32) (*Pty, error)

Create returns a new `Pty` object. This object is not ready for IO until `UpdateProcThreadAttribute` is called and a process has been started.

func (*Pty) Close

func (c *Pty) Close() error

Close closes the pseudo-terminal and cleans up all attached resources

func (*Pty) InPipe

func (c *Pty) InPipe() *os.File

InPipe returns the input pipe of the pseudo console.

func (*Pty) OutPipe

func (c *Pty) OutPipe() *os.File

OutPipe returns the output pipe of the pseudo console.

func (*Pty) Read

func (c *Pty) Read(buf []byte) (int, error)

Read reads from the pseudo console into `buf`. Returns the number of bytes read and an error if there is one.

func (*Pty) Resize

func (c *Pty) Resize(width, height int16) error

Resize resizes the internal buffers of the pseudo console to the passed in size

func (*Pty) UpdateProcThreadAttribute

func (c *Pty) UpdateProcThreadAttribute(attrList *windows.ProcThreadAttributeListContainer) error

UpdateProcThreadAttribute updates the passed in attribute list to contain the entry necessary for use with CreateProcess.

func (*Pty) Write

func (c *Pty) Write(buf []byte) (int, error)

Write writes the contents of `buf` to the pseudo console. Returns the number of bytes written and an error if there is one.

Jump to

Keyboard shortcuts

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