fix: Refresh in Files keeps the old list when the terminal cannot list the folder (#34551)

When the terminal refused to list the open folder, for example after its API key changed, pressing Refresh above the Files list kept the old entries on screen and said nothing. Refresh now clears the list and any ticked items and shows "Failed to load directory. Check your Terminal connection in Settings → Integrations.", the same as opening the folder does, and the next Refresh lists the folder again once the terminal answers. The list also reads itself again after a sort change, showing hidden files, a file change or a change on the terminal, and those reads show the same message when they fail.

Fixes #34550
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-17 02:39:47 +09:00
1 parent 93a7bbb185
commit 6ac7d11a3f
1 file changed
+5
+5
View File
@@ -1282,6 +1282,11 @@
error = null;
currentWritable = listings[0].writable !== false;
entries = normalizeEntries(listings[0].entries);
} else {
error =
'Failed to load directory. Check your Terminal connection in Settings → Integrations.';
entries = [];
clearSelection();
}
const cache = new Map(treeCache);
paths.forEach(