From d2801d0019794eca9054ac8788715a6dfa21ffd7 Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Mon, 22 Jul 2024 23:07:26 +0200 Subject: [PATCH] windows build now also working but without pty support. --- pkg/terminal/pty_windows.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pkg/terminal/pty_windows.go diff --git a/pkg/terminal/pty_windows.go b/pkg/terminal/pty_windows.go new file mode 100644 index 0000000..bdf8b73 --- /dev/null +++ b/pkg/terminal/pty_windows.go @@ -0,0 +1,24 @@ +package terminal + +import ( + "github.com/gliderlabs/ssh" + "io" + "os" + "os/exec" +) + +var PtySpawner = Spawner(func(sshSession ssh.Session, env []string, name string, arg ...string) (Process, error) { + return nil, nil +}) + +type ptyProcess struct { + cmd *exec.Cmd + f *os.File +} + +func (p ptyProcess) Pipe() io.ReadWriter { + return p.f +} +func (p ptyProcess) Wait() error { + return p.cmd.Wait() +}