Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions packages/cli/src/ui/utils/terminalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'];
Expand All @@ -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';
Expand All @@ -93,6 +102,11 @@ async function detectTerminal(): Promise<SupportedTerminal | null> {
// 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'))
Expand Down Expand Up @@ -302,6 +316,10 @@ async function configureWindsurf(): Promise<TerminalSetupResult> {
return configureVSCodeStyle('Windsurf', 'Windsurf');
}

async function configureAntigravity(): Promise<TerminalSetupResult> {
return configureVSCodeStyle('Antigravity', 'Antigravity');
}

/**
* Main terminal setup function that detects and configures the current terminal.
*
Expand Down Expand Up @@ -337,7 +355,7 @@ export async function terminalSetup(): Promise<TerminalSetupResult> {
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.',
};
}

Expand All @@ -348,6 +366,8 @@ export async function terminalSetup(): Promise<TerminalSetupResult> {
return configureCursor();
case 'windsurf':
return configureWindsurf();
case 'antigravity':
return configureAntigravity();
default:
return {
success: false,
Expand Down
Loading