fix: terminal clear on reset and data loss for text starting with {

Frontend:
- Clear xterm.js screen when receiving 'connected' status after reset
- Send resize message after clearing to ensure proper dimensions
- Fixes terminal artifacts after reset

Backend:
- Fix data loss bug: text starting with '{' but not valid JSON was silently dropped
- Now writes such text to session as regular input
- Fixes missing characters when user types '{'
This commit is contained in:
Fusion
2026-05-24 21:15:04 +02:00
parent 33b482ce91
commit 51b5d723ac
2 changed files with 21 additions and 6 deletions
+2 -1
View File
@@ -192,7 +192,8 @@ async def _write_loop(session_ref: SessionRef, websocket, instance_id: str) -> N
continue
except json.JSONDecodeError:
pass
# Not a valid JSON control message, treat as regular input
await session.write_input(text.encode("utf-8"))
else:
await session.write_input(text.encode("utf-8"))
elif message["type"] == "websocket.disconnect":