mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 17:41:24 -07:00
feat(cli): defer devtools startup and integrate with F12 (#18695)
This commit is contained in:
@@ -1518,7 +1518,34 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
}
|
||||
|
||||
if (keyMatchers[Command.SHOW_ERROR_DETAILS](key)) {
|
||||
setShowErrorDetails((prev) => !prev);
|
||||
if (settings.merged.general.devtools) {
|
||||
void (async () => {
|
||||
try {
|
||||
const { startDevToolsServer } = await import(
|
||||
'../utils/devtoolsService.js'
|
||||
);
|
||||
const { openBrowserSecurely, shouldLaunchBrowser } = await import(
|
||||
'@google/gemini-cli-core'
|
||||
);
|
||||
const url = await startDevToolsServer(config);
|
||||
if (shouldLaunchBrowser()) {
|
||||
try {
|
||||
await openBrowserSecurely(url);
|
||||
} catch (e) {
|
||||
setShowErrorDetails((prev) => !prev);
|
||||
debugLogger.warn('Failed to open browser securely:', e);
|
||||
}
|
||||
} else {
|
||||
setShowErrorDetails((prev) => !prev);
|
||||
}
|
||||
} catch (e) {
|
||||
setShowErrorDetails(true);
|
||||
debugLogger.error('Failed to start DevTools server:', e);
|
||||
}
|
||||
})();
|
||||
} else {
|
||||
setShowErrorDetails((prev) => !prev);
|
||||
}
|
||||
return true;
|
||||
} else if (keyMatchers[Command.SUSPEND_APP](key)) {
|
||||
const undoMessage = isITerm2()
|
||||
@@ -1651,6 +1678,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
lastOutputTimeRef,
|
||||
tabFocusTimeoutRef,
|
||||
showTransientMessage,
|
||||
settings.merged.general.devtools,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user