1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
//go:build !windows
// +build !windows
package conpty
import (
"os"
"syscall"
)
// ConPty represents a Windows Console Pseudo-terminal.
// https://learn.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session#preparing-the-communication-channels
type ConPty struct{}
// New creates a new ConPty.
// This function is not supported on non-Windows platforms.
func New(int, int, int) (*ConPty, error) {
return nil, ErrUnsupported
}
// Size returns the size of the ConPty.
func (*ConPty) Size() (int, int, error) {
return 0, 0, ErrUnsupported
}
// Close closes the ConPty.
func (*ConPty) Close() error {
return ErrUnsupported
}
// Fd returns the file descriptor of the ConPty.
func (*ConPty) Fd() uintptr {
return 0
}
// Read implements io.Reader.
func (*ConPty) Read([]byte) (int, error) {
return 0, ErrUnsupported
}
// Write implements io.Writer.
func (*ConPty) Write([]byte) (int, error) {
return 0, ErrUnsupported
}
// Resize resizes the ConPty.
func (*ConPty) Resize(int, int) error {
return ErrUnsupported
}
// InPipe implements pty.
func (c *ConPty) InPipe() *os.File {
return nil
}
// InPipeFd implements pty.
func (c *ConPty) InPipeFd() uintptr {
return 0
}
// OutPipe implements pty.
func (c *ConPty) OutPipe() *os.File {
return nil
}
// OutPipeFd implements pty.
func (c *ConPty) OutPipeFd() uintptr {
return 0
}
// Spawn implements pty.
func (c *ConPty) Spawn(name string, args []string, attr *syscall.ProcAttr) (pid int, handle uintptr, err error) {
return 0, 0, ErrUnsupported
}
|