aiorepl.py: fix infinite prompt spam with /dev/null

Previously, when running with "< /dev/null", the REPL was
continously sending the prompt "-->" which was needlessly
exploding the output.
This commit is contained in:
Thomas Farstrike
2026-03-24 12:37:21 +01:00
parent f27fab8bf5
commit acee8da477
+2 -1
View File
@@ -114,8 +114,9 @@ async def task(g=None, prompt="--> "):
curs = 0 # cursor offset from end of cmd buffer
while True:
b = await s.read(1)
# MPOS: return on EOF to avoid infinite prompt spam with /dev/null (differs from upstream).
if not b: # Handle EOF/empty read
break
return
pc = c # save previous character
c = ord(b)
pt = t # save previous time