Beispiel #1
0
// Resize handles a CLI event to resize an interactive docker run or docker exec
// window.
func (clnt *client) Resize(containerID, processFriendlyName string, width, height int) error {
	// Get the libcontainerd container object
	clnt.lock(containerID)
	defer clnt.unlock(containerID)
	cont, err := clnt.getContainer(containerID)
	if err != nil {
		return err
	}

	if processFriendlyName == InitFriendlyName {
		logrus.Debugln("Resizing systemPID in", containerID, cont.process.systemPid)
		return hcsshim.ResizeConsoleInComputeSystem(containerID, cont.process.systemPid, height, width)
	}

	for _, p := range cont.processes {
		if p.friendlyName == processFriendlyName {
			logrus.Debugln("Resizing exec'd process", containerID, p.systemPid)
			return hcsshim.ResizeConsoleInComputeSystem(containerID, p.systemPid, height, width)
		}
	}

	return fmt.Errorf("Resize could not find containerID %s to resize", containerID)

}
Beispiel #2
0
func (t *TtyConsole) Resize(h, w int) error {
	// TODO Windows: This is not implemented in HCS. Needs plumbing through
	// along with mechanism for buffering
	return hcsshim.ResizeConsoleInComputeSystem(t.id, t.processid, h, w)
}
Beispiel #3
0
// Resize implements Resize method of Terminal interface.
func (t *TtyConsole) Resize(h, w int) error {
	return hcsshim.ResizeConsoleInComputeSystem(t.id, t.processid, h, w)
}