From f8e9ae0acc44e42c8284ede4e19d8119701c6fae Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Mon, 9 Feb 2026 17:35:48 -0500 Subject: [PATCH] Add spacing between IF session exit messages --- src/mudlib/server.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mudlib/server.py b/src/mudlib/server.py index 27f6d6b..dff8e8b 100644 --- a/src/mudlib/server.py +++ b/src/mudlib/server.py @@ -340,20 +340,22 @@ async def shell( elif player.mode == "if" and player.if_session: response = await player.if_session.handle_input(command) if response.output: - await player.send(response.output) + # Ensure output ends with newline + output = response.output + if not output.endswith("\r\n"): + output += "\r\n" + await player.send(output) # Broadcast to spectators unless it's an escape command if not command.startswith("::"): spectator_msg = ( - f"[{player.name}'s terminal]\r\n" - f"> {command}\r\n" - f"{response.output}" + f"[{player.name}'s terminal]\r\n> {command}\r\n{output}" ) await broadcast_to_spectators(player, spectator_msg) if response.done: await player.if_session.stop() player.if_session = None player.mode_stack.pop() - await player.send("you leave the terminal.\r\n") + await player.send("\r\nyou leave the terminal.\r\n") # Notify spectators leave_msg = f"{player.name} steps away from the terminal.\r\n" await broadcast_to_spectators(player, leave_msg)