Explain pty Process abstraction (#3254)

Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
Spike Curtis 2022-07-27 17:03:55 -07:00 committed by GitHub
parent 6230d5512e
commit 043768076f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,11 @@ type PTY interface {
Resize(height uint16, width uint16) error
}
// Process represents a process running in a PTY
// Process represents a process running in a PTY. We need to trigger special processing on the PTY
// on process completion, meaning that we will have goroutines calling Wait() on the process. Since
// the caller will also typically wait for the process, and it is not safe for multiple goroutines
// to Wait() on a process, this abstraction provides a goroutine-safe interface for interacting with
// the process.
type Process interface {
// Wait for the command to complete. Returned error is as for exec.Cmd.Wait()