diff --git a/src/mudlib/if_session.py b/src/mudlib/if_session.py index 3ddca96..669eb6c 100644 --- a/src/mudlib/if_session.py +++ b/src/mudlib/if_session.py @@ -203,16 +203,21 @@ class IFSession: buf += chunk # Check for prompt at end of buffer - text = buf.decode("latin-1") + # dfrotz prompt is "\n> " (with trailing space) + text = buf.decode("latin-1").rstrip() if text.endswith("\n>"): - text = text[:-2] - return text.rstrip() + return text[:-2].rstrip() if text == ">": return "" except TimeoutError: pass - return buf.decode("latin-1").rstrip() + text = buf.decode("latin-1").rstrip() + if text.endswith("\n>"): + return text[:-2].rstrip() + if text == ">": + return "" + return text async def broadcast_to_spectators(player: "Player", message: str) -> None: