def resize(self, size=None):

        if not self.operation.israw():
            return

        size = size or tty.size(self.operation.stdout)

        if size is not None:
            rows, cols = size
            try:
                self.operation.resize(height=rows, width=cols)
            except IOError:  # Container already exited
                pass
Resize the container's PTY.
dataset/ETHPy150Open d11wtq/dockerpty/dockerpty/pty.py/PseudoTerminal.resize