fix: handle text+bytes in terminal WS; mkdir -p before SFTP upload; robust conda path detection

This commit is contained in:
2026-04-26 00:27:15 +00:00
parent a07a8df25d
commit 58188b6fea

View File

@@ -1,4 +1,4 @@
import asyncio
import asyncio
import json
import os
import tempfile
@@ -368,8 +368,11 @@ async def ws_terminal(websocket: WebSocket):
async def ws_to_ssh():
try:
while True:
data = await websocket.receive_bytes()
channel.send(data)
msg = await websocket.receive()
if "bytes" in msg and msg["bytes"]:
channel.send(msg["bytes"])
elif "text" in msg and msg["text"]:
channel.send(msg["text"].encode())
except WebSocketDisconnect:
pass