code: def _readline_insert(self, char, echo, insptr, line):
          
          if not self._readline_do_echo(echo):
              return
          # Write out the remainder of the line
          self.write(char + ''.join(line[insptr:]))
          # Cursor Left to the current insert point
          char_count = len(line) - insptr
          self.write(self.CODES['CSRLEFT'] * char_count)
docs: Deal properly with inserted chars in a line.