use pty/tty terminology similar to github.com/kr/pty

This commit is contained in:
Mahmood Ali 2019-05-10 18:44:19 -04:00
parent 7fdb7564e8
commit b4df061fef
2 changed files with 4 additions and 4 deletions

View file

@ -19,8 +19,8 @@ type execHelper struct {
logger hclog.Logger
// newTerminal function creates a tty appropriate for the command
// The returned master end of tty function is to be called after process start.
newTerminal func() (master func() (*os.File, error), slave *os.File, err error)
// The returned pty end of tty function is to be called after process start.
newTerminal func() (pty func() (*os.File, error), tty *os.File, err error)
// setTTY is a callback to configure the command with slave end of the tty of the terminal, when tty is enabled
setTTY func(tty *os.File) error
@ -61,7 +61,7 @@ func (e *execHelper) runTTY(ctx context.Context, stream drivers.ExecTaskStream)
pty, err := ptyF()
if err != nil {
return fmt.Errorf("failed to get tty master: %v", err)
return fmt.Errorf("failed to get pty: %v", err)
}
defer pty.Close()

View file

@ -506,7 +506,7 @@ func (l *LibcontainerExecutor) Exec(deadline time.Time, cmd string, args []strin
}
func (l *LibcontainerExecutor) newTerminalSocket() (master func() (*os.File, error), socket *os.File, err error) {
func (l *LibcontainerExecutor) newTerminalSocket() (pty func() (*os.File, error), tty *os.File, err error) {
parent, child, err := lutils.NewSockPair("socket")
if err != nil {
return nil, nil, fmt.Errorf("failed to create terminal: %v", err)