diff --git a/doc.go b/doc.go index 833c9f5..0cfb503 100644 --- a/doc.go +++ b/doc.go @@ -19,6 +19,7 @@ func Open() (Pty, Tty, error) { // FdHolder surfaces the Fd() method of the underlying handle. type FdHolder interface { Fd() uintptr + SetDeadline(t time.Time) error } // Pty for terminal control in current process. @@ -33,7 +34,6 @@ type Pty interface { // WriteString is only used to identify Pty and Tty. WriteString(s string) (n int, err error) - SetDeadline(t time.Time) error // TODO: Maybe move to FdHolder? io.ReadWriteCloser } @@ -47,7 +47,6 @@ type Tty interface { FdHolder Name() string - SetDeadline(t time.Time) error // TODO: Maybe move to FdHolder? io.ReadWriteCloser } diff --git a/pty_windows.go b/pty_windows.go index c10e7d0..cde03e7 100644 --- a/pty_windows.go +++ b/pty_windows.go @@ -34,7 +34,7 @@ var ( // the kernel32.dll is loaded from windows system path. // // Ref: https://pkg.go.dev/syscall@go1.13?GOOS=windows#LoadDLL - kernel32DLL = windows.NewLazyDLL("kernel32.dll") + kernel32DLL = windows.NewLazySystemDLL("kernel32.dll") // https://docs.microsoft.com/en-us/windows/console/createpseudoconsole createPseudoConsole = kernel32DLL.NewProc("CreatePseudoConsole") @@ -138,8 +138,8 @@ func (p *WindowsPty) Close() error { return err } -func (t *WindowsPty) SetDeadline(value time.Time) error { - return nil +func (p *WindowsPty) SetDeadline(value time.Time) error { + return os.ErrNoDeadline } func (t *WindowsTty) Name() string { @@ -164,7 +164,7 @@ func (t *WindowsTty) Close() error { } func (t *WindowsTty) SetDeadline(value time.Time) error { - return nil + return os.ErrNoDeadline } func procCreatePseudoConsole(hInput windows.Handle, hOutput windows.Handle, dwFlags uint32, consoleHandle *windows.Handle) error {