Skip to content

Commit 14d5846

Browse files
committed
fix: resolve websocket slicing error and fix forge run.bat crash by injecting JAVA_TOOL_OPTIONS
1 parent 5beea1b commit 14d5846

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

backend/api_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ async def websocket_console(websocket: WebSocket):
909909
state.active_websockets.append(websocket)
910910
# Replay history
911911
try:
912-
history = state.log_history[-200:]
912+
history = list(state.log_history)[-200:]
913913
if history:
914914
await websocket.send_json({"type": "batch", "items": history})
915915
except Exception as e:

backend/server/server_handler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,13 @@ def _get_start_command(self):
466466

467467
custom_env = os.environ.copy()
468468
custom_env["PYTHONIOENCODING"] = "utf-8"
469+
# Inyectar propiedades de Java globalmente para que run.bat/run.sh también las usen
470+
java_tools = (
471+
"-Djline.terminal=jline.UnsupportedTerminal -Dorg.jline.terminal.dumb=true"
472+
)
473+
existing_tools = custom_env.get("JAVA_TOOL_OPTIONS", "")
474+
custom_env["JAVA_TOOL_OPTIONS"] = f"{java_tools} {existing_tools}".strip()
475+
469476
if java_path != "java":
470477
# Extract installation root (assuming path/to/java-21/bin/java.exe)
471478
java_bin_dir = os.path.dirname(java_path)

0 commit comments

Comments
 (0)