fix: send terminal resize immediately on WebSocket connect
- Backend PTY starts with default 80x24 dimensions - Previous code only sent resize during layout changes - Now sends current terminal size immediately when WebSocket opens - Ensures PTY is properly sized before shell starts rendering
This commit is contained in:
@@ -79,6 +79,13 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
reconnectAttemptsRef.current = 0;
|
||||
lastPingRef.current = Date.now();
|
||||
|
||||
// Send current terminal size immediately on connect
|
||||
if (termRef.current) {
|
||||
const { cols, rows } = termRef.current;
|
||||
console.log(`[Terminal] Sending resize on connect: ${cols}x${rows}`);
|
||||
ws.send(JSON.stringify({ type: "resize", cols, rows }));
|
||||
}
|
||||
|
||||
// Start heartbeat check
|
||||
if (heartbeatCheckRef.current) {
|
||||
window.clearInterval(heartbeatCheckRef.current);
|
||||
|
||||
Reference in New Issue
Block a user