Skip to content

Commit 24a7108

Browse files
committed
Add support for terminal resizing in alloc exec
1 parent 3ae086e commit 24a7108

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

containerd/handle.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,20 @@ func (h *taskHandle) exec(ctx, ctxContainerd context.Context, taskID string, opt
143143
if err != nil {
144144
return nil, err
145145
}
146+
go func() {
147+
for {
148+
select {
149+
case s, ok := <-opts.ResizeCh:
150+
if !ok {
151+
return
152+
}
153+
if err = h.task.Resize(ctxContainerd, uint32(s.Width), uint32(s.Height)); err != nil {
154+
h.logger.Error("Failed to resize terminal", "error", err)
155+
return
156+
}
157+
}
158+
}
159+
}()
146160

147161
defer process.Delete(ctxContainerd)
148162

0 commit comments

Comments
 (0)