mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
use pty/tty terminology similar to github.com/kr/pty
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user