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 2026-10-05 09:15:42 +02:00 • committed by GitHub
parent 273180a0d7
commit 878c90eaaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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('/');