mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 23:21:27 -07:00
feat: Detect background color (#15132)
This commit is contained in:
@@ -39,6 +39,14 @@ vi.mock('node:process', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('../utils/terminalCapabilityManager.js', () => ({
|
||||
terminalCapabilityManager: {
|
||||
getTerminalName: vi.fn().mockReturnValue('Test Terminal'),
|
||||
getTerminalBackgroundColor: vi.fn().mockReturnValue('#000000'),
|
||||
isKittyProtocolEnabled: vi.fn().mockReturnValue(true),
|
||||
},
|
||||
}));
|
||||
|
||||
describe('bugCommand', () => {
|
||||
beforeEach(() => {
|
||||
vi.mocked(getVersion).mockResolvedValue('0.1.0');
|
||||
@@ -73,6 +81,9 @@ describe('bugCommand', () => {
|
||||
* **Sandbox Environment:** test
|
||||
* **Model Version:** gemini-pro
|
||||
* **Memory Usage:** 100 MB
|
||||
* **Terminal Name:** Test Terminal
|
||||
* **Terminal Background:** #000000
|
||||
* **Kitty Keyboard Protocol:** Supported
|
||||
* **IDE Client:** VSCode
|
||||
`;
|
||||
const expectedUrl =
|
||||
@@ -106,6 +117,9 @@ describe('bugCommand', () => {
|
||||
* **Sandbox Environment:** test
|
||||
* **Model Version:** gemini-pro
|
||||
* **Memory Usage:** 100 MB
|
||||
* **Terminal Name:** Test Terminal
|
||||
* **Terminal Background:** #000000
|
||||
* **Kitty Keyboard Protocol:** Supported
|
||||
* **IDE Client:** VSCode
|
||||
`;
|
||||
const expectedUrl = customTemplate
|
||||
|
||||
@@ -15,6 +15,7 @@ import { MessageType } from '../types.js';
|
||||
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
||||
import { formatMemoryUsage } from '../utils/formatters.js';
|
||||
import { IdeClient, sessionId, getVersion } from '@google/gemini-cli-core';
|
||||
import { terminalCapabilityManager } from '../utils/terminalCapabilityManager.js';
|
||||
|
||||
export const bugCommand: SlashCommand = {
|
||||
name: 'bug',
|
||||
@@ -38,6 +39,13 @@ export const bugCommand: SlashCommand = {
|
||||
const cliVersion = await getVersion();
|
||||
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
|
||||
const ideClient = await getIdeClientName(context);
|
||||
const terminalName =
|
||||
terminalCapabilityManager.getTerminalName() || 'Unknown';
|
||||
const terminalBgColor =
|
||||
terminalCapabilityManager.getTerminalBackgroundColor() || 'Unknown';
|
||||
const kittyProtocol = terminalCapabilityManager.isKittyProtocolEnabled()
|
||||
? 'Supported'
|
||||
: 'Unsupported';
|
||||
|
||||
let info = `
|
||||
* **CLI Version:** ${cliVersion}
|
||||
@@ -47,6 +55,9 @@ export const bugCommand: SlashCommand = {
|
||||
* **Sandbox Environment:** ${sandboxEnv}
|
||||
* **Model Version:** ${modelVersion}
|
||||
* **Memory Usage:** ${memoryUsage}
|
||||
* **Terminal Name:** ${terminalName}
|
||||
* **Terminal Background:** ${terminalBgColor}
|
||||
* **Kitty Keyboard Protocol:** ${kittyProtocol}
|
||||
`;
|
||||
if (ideClient) {
|
||||
info += `* **IDE Client:** ${ideClient}\n`;
|
||||
|
||||
Reference in New Issue
Block a user