Beispiel #1
0
 def _update_lines_cols(self):
     cols, lines = ansi.get_size()
     prev_cols = self.cols
     prev_lines = self.lines
     self.cols = cols
     self.lines = lines
     changed = prev_cols != self.cols or prev_lines != self.lines
     if changed:
         logger.debug(
             f"sizes: prev [{prev_lines}, {prev_cols}], new [{self.lines}, {self.cols}]"
         )
     return changed
Beispiel #2
0
 def _setsize(fd):
     cols, rows = ansi.get_size()
     s = struct.pack("HHHH", rows, cols, 0, 0)
     fcntl.ioctl(fd, termios.TIOCSWINSZ, s)