def _handle_resize(self, signum=None, frame=None):
        'Tries to catch resize signals sent from the terminal.'

        h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\0' * 8))[:2]
        self.term_width = w
Tries to catch resize signals sent from the terminal.
metadrive/render_pipeline/rplibs/progressbar/__init__.py