summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristine betts <[email protected]>2025-08-11 21:06:01 +0000
committerGitHub <[email protected]>2025-08-11 21:06:01 +0000
commitc0f5f6a5f66be43ebeebb03238ff4ff8fe87a154 (patch)
tree19845847e897336ed45159f37af1c98450d974ae
parent0e98641b51270f2f63ffb30902b44903d8e88383 (diff)
[ide-mode] Update handling of workspace paths (#6014)
Co-authored-by: Jacob Richman <[email protected]>
-rw-r--r--packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx2
-rw-r--r--packages/core/src/ide/ide-client.ts7
2 files changed, 7 insertions, 2 deletions
diff --git a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
index b4fe4167..fcdb743f 100644
--- a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
+++ b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
@@ -134,7 +134,7 @@ export const ToolConfirmationMessage: React.FC<
);
if (config?.getIdeMode() && config?.getIdeModeFeature()) {
options.push({
- label: 'No',
+ label: 'No (esc)',
value: ToolConfirmationOutcome.Cancel,
});
} else {
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.`,