Skip to content

Commit ed1e2f1

Browse files
mguijarrjonathanslenders
authored andcommitted
make the flush method re-entrant
1 parent 5aea076 commit ed1e2f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

prompt_toolkit/output/vt100.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ def flush(self) -> None:
669669
return
670670

671671
data = "".join(self._buffer)
672+
self._buffer = []
672673

673674
try:
674675
# Ensure that `self.stdout` is made blocking when writing into it.
@@ -709,8 +710,6 @@ def flush(self) -> None:
709710
else:
710711
raise
711712

712-
self._buffer = []
713-
714713
def ask_for_cpr(self) -> None:
715714
"""
716715
Asks for a cursor position report (CPR).

0 commit comments

Comments
 (0)