You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user