fix terminal sizing
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user