mirror of
https://github.com/coder/coder.git
synced 2025-07-23 21:32:07 +00:00
fix(agent): Close stdin and stdout separately to fix pty output loss (#6862)
Fixes #6656 Closes #6840
This commit is contained in:
committed by
GitHub
parent
349bfad2e9
commit
90d18dd2e5
@ -6,8 +6,12 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/gliderlabs/ssh"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
// ErrClosed is returned when a PTY is used after it has been closed.
|
||||
var ErrClosed = xerrors.New("pty: closed")
|
||||
|
||||
// PTY is a minimal interface for interacting with a TTY.
|
||||
type PTY interface {
|
||||
io.Closer
|
||||
@ -31,6 +35,11 @@ type PTY interface {
|
||||
// The same stream would be used to provide user input: pty.Input().Write(...)
|
||||
Input() ReadWriter
|
||||
|
||||
// Dup returns a new file descriptor for the PTY.
|
||||
//
|
||||
// This is useful for closing stdin and stdout separately.
|
||||
Dup() (*os.File, error)
|
||||
|
||||
// Resize sets the size of the PTY.
|
||||
Resize(height uint16, width uint16) error
|
||||
}
|
||||
|
Reference in New Issue
Block a user