code: def set_window_title(self, title: str) -> None:  # pragma: no cover
          
          if not vt100_support:
              return
  
          # Sanity check that can't fail if self.terminal_lock was acquired before calling this function
          if self.terminal_lock.acquire(blocking=False):
              try:
                  import colorama.ansi as ansi
                  sys.stderr.write(ansi.set_title(title))
              except AttributeError:
                  # Debugging in Pycharm has issues with setting terminal title
                  pass
              finally:
                  self.terminal_lock.release()
  
          else:
              raise RuntimeError("another thread holds terminal_lock")
docs: Set the terminal window title
  
          IMPORTANT: This function will not set the title unless it can acquire self.terminal_lock to avoid
                     writing to stderr while a command is running. Therefore it is best to acquire the lock
                     before calling this function to guarantee the title changes.
  
          :param title: the new window title
          :raises RuntimeError if called while another thread holds terminal_lock