summaryrefslogtreecommitdiff
path: root/packages/core
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core')
-rw-r--r--packages/core/src/ide/ide-client.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/core/src/ide/ide-client.ts b/packages/core/src/ide/ide-client.ts
index 92224389..0ab79e74 100644
--- a/packages/core/src/ide/ide-client.ts
+++ b/packages/core/src/ide/ide-client.ts
@@ -5,6 +5,7 @@
*/
import * as fs from 'node:fs';
+import * as path from 'node:path';
import {
detectIde,
DetectedIde,
@@ -249,7 +250,11 @@ export class IdeClient {
);
return false;
}
- if (getRealPath(ideWorkspacePath) !== getRealPath(process.cwd())) {
+
+ const idePath = getRealPath(ideWorkspacePath).toLocaleLowerCase();
+ const cwd = getRealPath(process.cwd()).toLocaleLowerCase();
+ const rel = path.relative(idePath, cwd);
+ if (rel.startsWith('..') || path.isAbsolute(rel)) {
this.setState(
IDEConnectionStatus.Disconnected,
`Directory mismatch. Gemini CLI is running in a different location than the open workspace in ${this.currentIdeDisplayName}. Please run the CLI from the same directory as your project's root folder.`,