code: def insert_text(self, text, at_end=False, error=False, prompt=False):
          
          if at_end:
              # Insert text at the end of the command line
              self.append_text_to_shell(text, error, prompt)
          else:
              # Insert text at current cursor position
              ConsoleBaseWidget.insert_text(self, text)
docs: Insert text at the current cursor position
          or at the end of the command line