mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 14:34:55 -07:00
Add support for Antigravity terminal in terminal setup utility (#16051)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
committed by
GitHub
parent
16da6918cb
commit
01d2d43737
@@ -14,6 +14,7 @@
|
|||||||
* - VS Code: Configures keybindings.json to send \\\r\n
|
* - VS Code: Configures keybindings.json to send \\\r\n
|
||||||
* - Cursor: Configures keybindings.json to send \\\r\n (VS Code fork)
|
* - Cursor: Configures keybindings.json to send \\\r\n (VS Code fork)
|
||||||
* - Windsurf: 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:
|
* For VS Code and its forks:
|
||||||
* - Shift+Enter: Sends \\\r\n (backslash followed by CRLF)
|
* - Shift+Enter: Sends \\\r\n (backslash followed by CRLF)
|
||||||
@@ -51,7 +52,7 @@ export interface TerminalSetupResult {
|
|||||||
requiresRestart?: boolean;
|
requiresRestart?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type SupportedTerminal = 'vscode' | 'cursor' | 'windsurf';
|
type SupportedTerminal = 'vscode' | 'cursor' | 'windsurf' | 'antigravity';
|
||||||
|
|
||||||
export function getTerminalProgram(): SupportedTerminal | null {
|
export function getTerminalProgram(): SupportedTerminal | null {
|
||||||
const termProgram = process.env['TERM_PROGRAM'];
|
const termProgram = process.env['TERM_PROGRAM'];
|
||||||
@@ -70,6 +71,14 @@ export function getTerminalProgram(): SupportedTerminal | null {
|
|||||||
) {
|
) {
|
||||||
return 'windsurf';
|
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
|
// Check VS Code last since forks may also set VSCODE env vars
|
||||||
if (termProgram === 'vscode' || process.env['VSCODE_GIT_IPC_HANDLE']) {
|
if (termProgram === 'vscode' || process.env['VSCODE_GIT_IPC_HANDLE']) {
|
||||||
return 'vscode';
|
return 'vscode';
|
||||||
@@ -93,6 +102,11 @@ async function detectTerminal(): Promise<SupportedTerminal | null> {
|
|||||||
// Check forks before VS Code to avoid false positives
|
// Check forks before VS Code to avoid false positives
|
||||||
if (parentName.includes('windsurf') || parentName.includes('Windsurf'))
|
if (parentName.includes('windsurf') || parentName.includes('Windsurf'))
|
||||||
return 'windsurf';
|
return 'windsurf';
|
||||||
|
if (
|
||||||
|
parentName.includes('antigravity') ||
|
||||||
|
parentName.includes('Antigravity')
|
||||||
|
)
|
||||||
|
return 'antigravity';
|
||||||
if (parentName.includes('cursor') || parentName.includes('Cursor'))
|
if (parentName.includes('cursor') || parentName.includes('Cursor'))
|
||||||
return 'cursor';
|
return 'cursor';
|
||||||
if (parentName.includes('code') || parentName.includes('Code'))
|
if (parentName.includes('code') || parentName.includes('Code'))
|
||||||
@@ -302,6 +316,10 @@ async function configureWindsurf(): Promise<TerminalSetupResult> {
|
|||||||
return configureVSCodeStyle('Windsurf', 'Windsurf');
|
return configureVSCodeStyle('Windsurf', 'Windsurf');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function configureAntigravity(): Promise<TerminalSetupResult> {
|
||||||
|
return configureVSCodeStyle('Antigravity', 'Antigravity');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main terminal setup function that detects and configures the current terminal.
|
* Main terminal setup function that detects and configures the current terminal.
|
||||||
*
|
*
|
||||||
@@ -337,7 +355,7 @@ export async function terminalSetup(): Promise<TerminalSetupResult> {
|
|||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message:
|
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<TerminalSetupResult> {
|
|||||||
return configureCursor();
|
return configureCursor();
|
||||||
case 'windsurf':
|
case 'windsurf':
|
||||||
return configureWindsurf();
|
return configureWindsurf();
|
||||||
|
case 'antigravity':
|
||||||
|
return configureAntigravity();
|
||||||
default:
|
default:
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user