Help us shape the future of Go! Take the 2026 Go Developer Survey

conpty

package
v1.104.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package conpty implements support for Windows pseudo-consoles.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupported is returned by NewPseudoConsole if the current Windows
	// build does not support this package's API.
	ErrUnsupported = errors.New("conpty unsupported on this version of Windows")
)

Functions

This section is empty.

Types

type PseudoConsole

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

PseudoConsole encapsulates a Windows pseudo-console. Use NewPseudoConsole to create a new instance.

func NewPseudoConsole

func NewPseudoConsole(size windows.Coord) (pty *PseudoConsole, err error)

NewPseudoConsole creates a new PseudoConsole using size for its initial width and height. It requires Windows 10 1809 or newer, and will return ErrUnsupported if that requirement is not met.

func (*PseudoConsole) Close

func (pty *PseudoConsole) Close() error

Close shuts down the pty. The caller must continue reading from the ReadCloser returned by Output until either EOF is reached or Close returns; failure to adequately drain the ReadCloser may result in Close deadlocking.

func (*PseudoConsole) ConfigureStartupInfo

func (pty *PseudoConsole) ConfigureStartupInfo(sib *winutil.StartupInfoBuilder) error

ConfigureStartupInfo associates pty with the process to be started using sib.

func (*PseudoConsole) InputPipe

func (pty *PseudoConsole) InputPipe() io.WriteCloser

InputPipe returns the WriteCloser for writing pty's output.

func (*PseudoConsole) OutputPipe

func (pty *PseudoConsole) OutputPipe() io.ReadCloser

OutputPipe returns the ReadCloser for reading pty's output.

func (*PseudoConsole) Resize

func (pty *PseudoConsole) Resize(size windows.Coord) error

Resize sets the width and height of pty to size.

Jump to

Keyboard shortcuts

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