| 160 | self.repl.send_to_stdin(self.current_line) |
| 161 | |
| 162 | def add_input_character(self, e: str) -> None: |
| 163 | if e == "<SPACE>": |
| 164 | e = " " |
| 165 | if e.startswith("<") and e.endswith(">"): |
| 166 | return |
| 167 | assert len(e) == 1, "added multiple characters: %r" % e |
| 168 | logger.debug("adding normal char %r to current line", e) |
| 169 | |
| 170 | self.current_line = ( |
| 171 | self.current_line[: self.cursor_offset] |
| 172 | + e |
| 173 | + self.current_line[self.cursor_offset :] |
| 174 | ) |
| 175 | self.cursor_offset += 1 |
| 176 | |
| 177 | def readline(self, size: int = -1) -> str: |
| 178 | if not isinstance(size, int): |