fix terminal sizing

This commit is contained in:
Raven Scott
2025-11-25 02:27:02 -05:00
parent ae032cc6aa
commit 448087a583
9 changed files with 202 additions and 5 deletions
+10
View File
@@ -1765,6 +1765,16 @@ async function handleTerminal(containerId, peer) {
? Buffer.from(parsed.data, 'base64')
: Buffer.from(parsed.data);
stream.write(inputData);
} else if (parsed.type === 'terminalResize' && parsed.containerId === containerId) {
// Handle terminal resize
if (parsed.cols && parsed.rows && parsed.cols > 0 && parsed.rows > 0) {
try {
exec.resize({ h: parsed.rows, w: parsed.cols });
console.log(`[INFO] Terminal resized for container ${containerId}: ${parsed.cols}x${parsed.rows}`);
} catch (resizeErr) {
console.error(`[ERROR] Failed to resize terminal: ${resizeErr.message}`);
}
}
}
} catch (err) {
console.error(`[ERROR] Failed to parse terminal input: ${err.message}`);