Skip to content

Commit 89e4620

Browse files
committed
skip wrapping
1 parent bb87563 commit 89e4620

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Lib/_pyrepl/windows_console.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,19 +282,13 @@ def __write_changed_line(
282282
self._erase_to_end()
283283

284284
self.__write(newline[x_pos:])
285-
if wlen(newline) == self.width:
286-
# If we wrapped we want to start at the next line
287-
self.__write("\r\n")
288-
self._move_relative(0, y + 1)
289-
self.posxy = 0, y + 1
290-
else:
291-
self.posxy = wlen(newline), y
285+
self.posxy = min(wlen(newline), self.width - 1), y
292286

293-
if "\x1b" in newline or y != self.posxy[1] or '\x1a' in newline:
294-
# ANSI escape characters are present, so we can't assume
295-
# anything about the position of the cursor. Moving the cursor
296-
# to the left margin should work to get to a known position.
297-
self.move_cursor(0, y)
287+
if "\x1b" in newline or y != self.posxy[1] or '\x1a' in newline:
288+
# ANSI escape characters are present, so we can't assume
289+
# anything about the position of the cursor. Moving the cursor
290+
# to the left margin should work to get to a known position.
291+
self.move_cursor(0, y)
298292

299293
def _scroll(
300294
self, top: int, bottom: int, left: int | None = None, right: int | None = None

0 commit comments

Comments
 (0)