--- cpython/Lib/pty.py 2020-08-17 19:38:35.113811651 -0500 +++ pty.py 2020-08-17 19:43:13.021171983 -0500 @@ -148,6 +148,22 @@ else: _writen(master_fd, data) +def _setwinsz(master_fd): + """Sets window size.""" + try: + from struct import pack, error as StructError + from fcntl import ioctl + from termios import TIOCGWINSZ, TIOCSWINSZ + except ImportError: + pass + else: + try: + w = pack('HHHH', 0, 0, 0, 0) + s = ioctl(STDIN_FILENO, TIOCGWINSZ, w) + ioctl(master_fd, TIOCSWINSZ, s) + except (struct.error, OSError): + pass + def spawn(argv, master_read=_read, stdin_read=_read): """Create a spawned process.""" if type(argv) == type(''): @@ -162,6 +178,7 @@ restore = 1 except tty.error: # This is the same as termios.error restore = 0 + _setwinsz(master_fd) try: _copy(master_fd, master_read, stdin_read) except OSError: