Add spacing between IF session exit messages

This commit is contained in:
Jared Miller 2026-02-09 17:35:48 -05:00
parent 54cd0f6656
commit f8e9ae0acc
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -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)