def start(self):

        def handle(signum, frame):
            if signum == signal.SIGWINCH:
                self.pty.resize()

        self.original_handler = signal.signal(signal.SIGWINCH, handle)
Start trapping WINCH signals and resizing the PTY.
dataset/ETHPy150Open d11wtq/dockerpty/dockerpty/pty.py/WINCHHandler.start