code: def rl_make_safe_prompt(prompt: str) -> str:  # pragma: no cover
      
      if rl_type == RlType.GNU:
          # start code to tell GNU Readline about beginning of invisible characters
          start = "\x01"
  
          # end code to tell GNU Readline about end of invisible characters
          end = "\x02"
  
          escaped = False
          result = ""
  
          for c in prompt:
              if c == "\x1b" and not escaped:
                  result += start + c
                  escaped = True
              elif c.isalpha() and escaped:
                  result += c + end
                  escaped = False
              else:
                  result += c
  
          return result
  
      else:
          return prompt
docs: Overcome bug in GNU Readline in relation to calculation of prompt length in presence of ANSI escape codes.
  
      :param prompt: original prompt
      :return: prompt safe to pass to GNU Readline