winpty

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN       = 1
	WINPTY_SPAWN_FLAG_EXIT_AFTER_SHUTDOWN = 2

	WINPTY_FLAG_CONERR                         = 0x1
	WINPTY_FLAG_PLAIN_OUTPUT                   = 0x2
	WINPTY_FLAG_COLOR_ESCAPES                  = 0x4
	WINPTY_FLAG_ALLOW_CURPROC_DESKTOP_CREATION = 0x8

	WINPTY_MOUSE_MODE_NONE  = 0
	WINPTY_MOUSE_MODE_AUTO  = 1
	WINPTY_MOUSE_MODE_FORCE = 2
)

Variables

View Source
var (

	//windows api
	GetProcessId *syscall.LazyProc
)

Functions

func GetErrorCode

func GetErrorCode(err uintptr) uint32

func GetErrorMessage

func GetErrorMessage(err uintptr) string

func SetAgentTimeout

func SetAgentTimeout(winptyConfigT uintptr, timeoutMs uint64)

set pty timeout

func SetMouseMode

func SetMouseMode(winptyConfigT uintptr, mode uint)

set pty mouse mode

func UTF16PtrFromStringArray

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

func UTF16PtrToString

func UTF16PtrToString(p *uint16) string

Types

type Options

type Options struct {
	// DllDir is the path to winpty.dll and winpty-agent.exe
	DllDir string
	// FilePath sets the title of the console
	FilePath 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
	// AgentFlags to pass to agent config creation
	AgentFlags uint64
	SpawnFlag  uint32
	MouseModes uint
	// Initial size for Columns and Rows
	InitialCols uint32
	InitialRows uint32
	// contains filtered or unexported fields
}

type WinPTY

type WinPTY struct {
	Stdin  *os.File
	Stdout *os.File
	Stderr *os.File
	// contains filtered or unexported fields
}

func OpenDefault

func OpenDefault(dllPrefix, cmd, dir string) (*WinPTY, error)

the same as open, but uses defaults for Env

func OpenWithOptions

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

func (*WinPTY) Close

func (pty *WinPTY) Close() error

close proc

func (*WinPTY) GetAgentProcHandle

func (pty *WinPTY) GetAgentProcHandle() uintptr

get pty proc

func (*WinPTY) GetProcHandle

func (pty *WinPTY) GetProcHandle() uintptr

get pty sub proc

func (*WinPTY) Pid

func (pty *WinPTY) Pid() int

func (*WinPTY) SetSize

func (pty *WinPTY) SetSize(wsCol, wsRow uint32) error

set windows size

Jump to

Keyboard shortcuts

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