Documentation ¶
Rendered for windows/amd64
Index ¶
- Constants
- Variables
- func CreateConsoleProcessAttachedToPTY(hpc windows.Handle, commandLine string, envs []string) (*windows.ProcessInformation, error)
- func CreateEnvBlock(envv []string) ([]uint16, error)
- func EnableVirtualTerminalProcessing() error
- func SetRawMode() (inHandle, outHandle windows.Handle)
- func Win32ClosePseudoConsole(hPc windows.Handle)
- func Win32CreatePseudoConsole(coord *COORD, hIn, hOut windows.Handle) (windows.Handle, error)
- func Win32ResizePseudoConsole(hPc windows.Handle, coord *COORD) error
- func WinCloseHandles(handles ...windows.Handle) error
- func WinIsConPtyAvailable() bool
- func WinIsDataAvailable(handle windows.Handle) (bytesAvailable int, err error)
- type COORD
- type ConPty
- type HandleWrapper
- type StartupInfoEx
Constants ¶
View Source
const ( PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE uintptr = 0x20016 STILL_ACTIVE uint32 = 259 )
View Source
const (
S_OK uintptr = 0
)
Variables ¶
View Source
var (
ErrConPtyUnsupported = errors.New("ConPty is not available on this version of Windows")
)
Functions ¶
func CreateEnvBlock ¶
CreateEnvBlock converts an array of environment strings into the representation required by CreateProcess: a sequence of NUL terminated strings followed by a nil. Last bytes are two UCS-2 NULs, or four NUL bytes. If any string contains a NUL, it returns (nil, EINVAL).
func EnableVirtualTerminalProcessing ¶
func EnableVirtualTerminalProcessing() error
func SetRawMode ¶
func Win32ClosePseudoConsole ¶
func WinCloseHandles ¶
This will only return the first error.
func WinIsConPtyAvailable ¶
func WinIsConPtyAvailable() bool
Types ¶
type ConPty ¶
type ConPty struct {
// contains filtered or unexported fields
}
func Start ¶
Start a new process specified in `commandLine` and attach a pseudo console using the Windows ConPty API. If ConPty is not available, ErrConPtyUnsupported will be returned. On successful return, an instance of ConPty is returned. You must call Close() on this to release any resources associated with the process. To get the exit code of the process, you can call Wait().
type HandleWrapper ¶
type HandleWrapper struct {
// contains filtered or unexported fields
}
func (*HandleWrapper) Close ¶
func (h *HandleWrapper) Close() error
func (*HandleWrapper) GetHandle ¶
func (h *HandleWrapper) GetHandle() windows.Handle
type StartupInfoEx ¶
type StartupInfoEx struct {
// contains filtered or unexported fields
}
func GetStartupInfoExForPTY ¶
func GetStartupInfoExForPTY(hpc windows.Handle) (*StartupInfoEx, error)
Click to show internal directories.
Click to hide internal directories.