def set_pty_size(self, p1, p2, p3, p4): buf = array.array('h', [p1, p2, p3, p4]) #fcntl.ioctl(pty.STDOUT_FILENO, termios.TIOCSWINSZ, buf) fcntl.ioctl(self.master, termios.TIOCSWINSZ, buf)