def reset_line(text = "")
      # Initialise ANSI escape string
      escape = ""

      # Get terminal window width
      cols = console_columns

      # The number of lines the previous message spanned
      lines = @@prev / cols

      # If cols == 80 and @@prev == 80, @@prev / cols == 1 but we don't want to
      # go up an extra line since it fits exactly
      lines -= 1 if @@prev % cols == 0

      # Clear and go up a line
      lines.times { escape += "#{ESC_R_AND_CLR}#{ESC_UP_A_LINE}" }

      # Clear the line that is to be printed on
      escape += "#{ESC_R_AND_CLR}"

      # Console is clear, we can print!
      $console.print "#{escape}#{text}"

      # Store the current message so we know how many lines it spans
      @@prev = text.to_s.length
    end
def reset_line(text = "")
      # Initialise ANSI escape string
      escape = ""

      # Get terminal window width
      cols = console_columns

      # The number of lines the previous message spanned
      lines = @@prev / cols

      # If cols == 80 and @@prev == 80, @@prev / cols == 1 but we don't want to
      # go up an extra line since it fits exactly
      lines -= 1 if @@prev % cols == 0

      # Clear and go up a line
      lines.times { escape += "#{ESC_R_AND_CLR}#{ESC_UP_A_LINE}" }

      # Clear the line that is to be printed on
      escape += "#{ESC_R_AND_CLR}"

      # Console is clear, we can print!
      $console.print "#{escape}#{text}"

      # Store the current message so we know how many lines it spans
      @@prev = text.to_s.length
    end
Manages line reset in the console