Documentation ¶
Overview ¶
Package conpty implements support for Windows pseudo-consoles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.