Skip to content
PlattySSHPublic

About

Start processes in a pseudo terminal (ConPTY on Windows, /dev/ptmx on Linux and macOS), with resize and clean shutdown

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

pty

Start processes inside a pseudo terminal, with resize and clean shutdown. It uses ConPTY on Windows and /dev/ptmx on Linux and macOS, with no cgo. On other platforms Start returns ErrUnsupported.

It runs the local shells in Platty.

go get github.com/plattyssh/pty
p, err := pty.Start(pty.Options{
	Command: []string{"bash", "-l"},
	Cols:    120,
	Rows:    30,
})

if err != nil {
	log.Fatal(err)
}

defer p.Close()
go io.Copy(os.Stdout, p)
p.Resize(100, 40)
code, _ := p.Wait()

With no Command, it starts the user's shell: $SHELL on Unix, PowerShell or cmd.exe on Windows.

Requires Windows 10 1809 or later on Windows.

License

MIT

About

Start processes in a pseudo terminal (ConPTY on Windows, /dev/ptmx on Linux and macOS), with resize and clean shutdown

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages