fix: Fix tab reload/state loss whenever moving them to the rigbht

This commit is contained in:
LukeGus
2025-10-22 11:47:02 -05:00
parent 471e2ff3fa
commit 0e8beaaa64
4 changed files with 196 additions and 111 deletions

View File

@@ -720,6 +720,9 @@ export const Terminal = forwardRef<TerminalHandle, SSHTerminalProps>(
setVisible(true);
return () => {
console.log(
`🔴 Terminal UNMOUNTING - this should NOT happen during drag!`,
);
isUnmountingRef.current = true;
shouldNotReconnectRef.current = true;
isReconnectingRef.current = false;
@@ -742,10 +745,21 @@ export const Terminal = forwardRef<TerminalHandle, SSHTerminalProps>(
}, [xtermRef, terminal]);
useEffect(() => {
console.log(`📡 Terminal connection useEffect triggered:`, {
terminal: !!terminal,
hostConfig: !!hostConfig,
visible,
isConnected,
isConnecting,
});
if (!terminal || !hostConfig || !visible) return;
if (isConnected || isConnecting) return;
console.log(
`🔌 Initiating NEW connection - this should only happen on mount!`,
);
setIsConnecting(true);
const readyFonts =