fix: terminal and file browser jump back to the top folder after every command (#31878)

The terminal runs commands in whatever folder the file browser panel is showing. When the file browser is limited to a top folder (OPEN_TERMINAL_FILE_BROWSER_ROOT, set to the home folder by default), every time the agent ran a command in the terminal the panel jumped back to that top folder and closed the open file, so the next command ran there too. Now the panel stays in the folder you picked and just reloads its contents after each command, keeping the open file in view.

Fixes #30051
This commit is contained in:
Classic298 authored and GitHub committed 2026-10-05 11:15:42 +04:00
1 parent 273180a0d7
commit 878c90eaaa
1 file changed
+1 -2
+1 -2
View File
@@ -1441,8 +1441,7 @@
showFileNavDir.set(null);
filePath = normalizePath(filePath);
if (!isInsideFileRoot(filePath)) {
await loadDir(fileRoot?.path ?? '/');
return;
filePath = fileRoot?.path ?? '/';
}
const lastSlash = filePath.lastIndexOf('/');