code: def report_device_status(self, mode):
          
          if mode == 5:    # Request for terminal status.
              self.write_process_input(ctrl.CSI + "0n")
          elif mode == 6:  # Request for cursor position.
              x = self.cursor.x + 1
              y = self.cursor.y + 1
  
              # "Origin mode (DECOM) selects line numbering."
              if mo.DECOM in self.mode:
                  y -= self.margins.top
              self.write_process_input(ctrl.CSI + "{0};{1}R".format(y, x))
docs: Report terminal status or cursor position.
  
          :param int mode: if 5 -- terminal status, 6 -- cursor position,
                           otherwise a noop.
  
          .. versionadded:: 0.5.0