winpty

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN            = 1
	WINPTY_FLAG_ALLOW_CURPROC_DESKTOP_CREATION = 0x8
)

Variables

This section is empty.

Functions

func GetErrorMessage

func GetErrorMessage(ptr uintptr) string

func UTF16PtrFromStringArray

func UTF16PtrFromStringArray(s []string) (*uint16, error)

Types

type Options

type Options struct {
	// AppName sets the title of the console
	AppName string

	// Command is the full command to launch
	Command string

	// Dir sets the current working directory for the command
	Dir string

	// Env sets the environment variables. Use the format VAR=VAL.
	Env []string

	// Flags to pass to agent config creation
	Flags uint32

	// Initial size for Columns and Rows
	InitialCols uint32
	InitialRows uint32
}

type WinPTY

type WinPTY struct {
	StdIn  *os.File
	StdOut *os.File
	// contains filtered or unexported fields
}

func Open

func Open(cmd string, InitialCols, InitialRows uint32) (*WinPTY, error)

the same as open, but uses defaults for Env & Dir

func OpenWithOptions

func OpenWithOptions(options Options) (*WinPTY, error)

func (*WinPTY) Close

func (obj *WinPTY) Close()

func (*WinPTY) GetProcHandle

func (obj *WinPTY) GetProcHandle() uintptr

func (*WinPTY) Read

func (wp *WinPTY) Read(b []byte) (n int, err error)

func (*WinPTY) SetSize

func (obj *WinPTY) SetSize(ws_col, ws_row uint32)

func (*WinPTY) Write

func (wp *WinPTY) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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