code: def paused(self):
          
          self.mainloop.stop()
          try:
              yield
          finally:
              self.mainloop.start()
  
              # make sure urwid renders its canvas at the correct size
              self.mainloop.screen_size = None
              self.mainloop.draw_screen()
docs: context manager that pauses the UI to allow running external commands.
  
          If an exception occurs, the UI will be started before the exception is
          re-raised.