mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(server): skip home directory in workspace prefix matching
When resolving a workspace for a given cwd, the prefix matching loop would match the user's home directory (~) as a prefix for any path under it. This caused new projects created under the home directory to be incorrectly associated with the home workspace instead of getting their own independent workspace. Added a check to skip the home directory (homedir()) during prefix matching. Exact matches for the home directory still work fine. Fixes #BUG Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6010,8 +6010,10 @@ export class Session {
|
||||
return exact.workspaceId;
|
||||
}
|
||||
|
||||
const userHome = homedir();
|
||||
let bestMatch: PersistedWorkspaceRecord | null = null;
|
||||
for (const workspace of workspaces) {
|
||||
if (workspace.cwd === userHome) continue;
|
||||
const prefix = workspace.cwd.endsWith(sep) ? workspace.cwd : `${workspace.cwd}${sep}`;
|
||||
if (!normalizedCwd.startsWith(prefix)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user