25 lines
		
	
	
		
			390 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			390 B
		
	
	
	
		
			Go
		
	
	
	
	
	
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()
 | 
						|
}
 |