package conpty

import "github.com/Microsoft/hcsshim/internal/conpty"

Index

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.

Source Files

conpty.go doc.go

Version
v0.13.0 (latest)
Published
Apr 21, 2025
Platform
windows/amd64
Imports
7 packages
Last checked
3 hours ago

Tools for package owners.