def set_pty_size(fd, size):

    rows, cols = size
    fcntl.ioctl(
        fd,
        termios.TIOCSWINSZ,
        struct.pack('hhhh', rows, cols, 0, 0)
    )
Resize the PTY at `fd` to (rows, cols) size.
dataset/ETHPy150Open d11wtq/dockerpty/tests/util.py/set_pty_size