diff --git a/process.go b/process.go index 3f6edcd0d..f98304fee 100644 --- a/process.go +++ b/process.go @@ -96,3 +96,17 @@ func (p *process) CloseStdin(ctx context.Context) error { }) return err } + +func (p *process) IO() *IO { + return p.io +} + +func (p *process) Resize(ctx context.Context, w, h uint32) error { + _, err := p.task.client.TaskService().Pty(ctx, &execution.PtyRequest{ + ContainerID: p.task.containerID, + Width: w, + Height: h, + Pid: p.pid, + }) + return err +} diff --git a/task.go b/task.go index 21bf92a3f..ead1ea6c0 100644 --- a/task.go +++ b/task.go @@ -33,6 +33,7 @@ type Task interface { Exec(context.Context, *specs.Process, IOCreation) (Process, error) Processes(context.Context) ([]uint32, error) CloseStdin(context.Context) error + Resize(ctx context.Context, w, h uint32) error IO() *IO } @@ -42,6 +43,8 @@ type Process interface { Kill(context.Context, syscall.Signal) error Wait(context.Context) (uint32, error) CloseStdin(context.Context) error + Resize(ctx context.Context, w, h uint32) error + IO() *IO } var _ = (Task)(&task{}) @@ -173,3 +176,13 @@ func (t *task) CloseStdin(ctx context.Context) error { func (t *task) IO() *IO { return t.io } + +func (t *task) Resize(ctx context.Context, w, h uint32) error { + _, err := t.client.TaskService().Pty(ctx, &execution.PtyRequest{ + ContainerID: t.containerID, + Width: w, + Height: h, + Pid: t.pid, + }) + return err +}