fix(sftp): sync reconnect host on tab reuse and home-fallback stale paths

Update lastConnectedHost when auto-connect reselects an existing tab, and
always try the detected home directory when a remembered start path fails.
This commit is contained in:
bincxz committed 2026-07-15 00:41:40 +08:00
1 parent 7538dd0b9f
commit 8a95fa1eda
3 files changed
+17 -1

No files matched your search

+3
View File
@@ -351,6 +351,9 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
);
if (existingTab) {
s.selectTab("left", existingTab.id);
// selectTab does not update reconnect metadata; keep lastConnectedHost
// aligned with the tab we just activated so channel drops rebind correctly.
s.setLastConnectedHost?.("left", activeHost);
connectedKeyRef.current = connectionKey;
connectedHostObjRef.current = activeHost;
// Session memory keys are per terminal session; republish the visible