mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -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
|
||||
* - 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<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'))
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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.',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -348,6 +366,8 @@ export async function terminalSetup(): Promise<TerminalSetupResult> {
|
||||
return configureCursor();
|
||||
case 'windsurf':
|
||||
return configureWindsurf();
|
||||
case 'antigravity':
|
||||
return configureAntigravity();
|
||||
default:
|
||||
return {
|
||||
success: false,
|
||||
|
||||
Reference in New Issue
Block a user