diff --git a/packages/cli/src/ui/utils/terminalSetup.ts b/packages/cli/src/ui/utils/terminalSetup.ts index 9fb81099bb..ede409dd49 100644 --- a/packages/cli/src/ui/utils/terminalSetup.ts +++ b/packages/cli/src/ui/utils/terminalSetup.ts @@ -14,6 +14,7 @@ * - VS Code: Configures keybindings.json to send \\\r\n * - Cursor: Configures keybindings.json to send \\\r\n (VS Code fork) * - Windsurf: Configures keybindings.json to send \\\r\n (VS Code fork) + * - Antigravity: Configures keybindings.json to send \\\r\n (VS Code fork) * * For VS Code and its forks: * - Shift+Enter: Sends \\\r\n (backslash followed by CRLF) @@ -51,7 +52,7 @@ export interface TerminalSetupResult { requiresRestart?: boolean; } -type SupportedTerminal = 'vscode' | 'cursor' | 'windsurf'; +type SupportedTerminal = 'vscode' | 'cursor' | 'windsurf' | 'antigravity'; export function getTerminalProgram(): SupportedTerminal | null { const termProgram = process.env['TERM_PROGRAM']; @@ -70,6 +71,14 @@ export function getTerminalProgram(): SupportedTerminal | null { ) { return 'windsurf'; } + // Check for Antigravity-specific indicators + if ( + process.env['VSCODE_GIT_ASKPASS_MAIN'] + ?.toLowerCase() + .includes('antigravity') + ) { + return 'antigravity'; + } // Check VS Code last since forks may also set VSCODE env vars if (termProgram === 'vscode' || process.env['VSCODE_GIT_IPC_HANDLE']) { return 'vscode'; @@ -93,6 +102,11 @@ async function detectTerminal(): Promise { // Check forks before VS Code to avoid false positives if (parentName.includes('windsurf') || parentName.includes('Windsurf')) return 'windsurf'; + if ( + parentName.includes('antigravity') || + parentName.includes('Antigravity') + ) + return 'antigravity'; if (parentName.includes('cursor') || parentName.includes('Cursor')) return 'cursor'; if (parentName.includes('code') || parentName.includes('Code')) @@ -302,6 +316,10 @@ async function configureWindsurf(): Promise { return configureVSCodeStyle('Windsurf', 'Windsurf'); } +async function configureAntigravity(): Promise { + return configureVSCodeStyle('Antigravity', 'Antigravity'); +} + /** * Main terminal setup function that detects and configures the current terminal. * @@ -337,7 +355,7 @@ export async function terminalSetup(): Promise { return { success: false, message: - 'Could not detect terminal type. Supported terminals: VS Code, Cursor, and Windsurf.', + 'Could not detect terminal type. Supported terminals: VS Code, Cursor, Windsurf, and Antigravity.', }; } @@ -348,6 +366,8 @@ export async function terminalSetup(): Promise { return configureCursor(); case 'windsurf': return configureWindsurf(); + case 'antigravity': + return configureAntigravity(); default: return { success: false,