diff --git a/packages/cli/src/config/footerItems.test.ts b/packages/cli/src/config/footerItems.test.ts index 9e32dcb175..a5b758bfb2 100644 --- a/packages/cli/src/config/footerItems.test.ts +++ b/packages/cli/src/config/footerItems.test.ts @@ -120,6 +120,7 @@ describe('footerItems', () => { 'quota', 'memory-usage', 'session-id', + 'hostname', 'code-changes', 'token-count', ]); diff --git a/packages/cli/src/config/footerItems.ts b/packages/cli/src/config/footerItems.ts index 612418a48f..faed6efd21 100644 --- a/packages/cli/src/config/footerItems.ts +++ b/packages/cli/src/config/footerItems.ts @@ -47,6 +47,11 @@ export const ALL_ITEMS = [ header: 'session', description: 'Unique identifier for the current session', }, + { + id: 'hostname', + header: 'machine', + description: 'Current machine hostname', + }, { id: 'auth', header: '/auth', @@ -75,6 +80,7 @@ export const DEFAULT_ORDER = [ 'quota', 'memory-usage', 'session-id', + 'hostname', 'auth', 'code-changes', 'token-count', diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx index d21345d831..378e89e453 100644 --- a/packages/cli/src/ui/components/Footer.tsx +++ b/packages/cli/src/ui/components/Footer.tsx @@ -18,6 +18,7 @@ import { } from '@google/gemini-cli-core'; import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js'; import process from 'node:process'; +import os from 'node:os'; import { MemoryUsageDisplay } from './MemoryUsageDisplay.js'; import { ContextUsageDisplay } from './ContextUsageDisplay.js'; import { QuotaDisplay } from './QuotaDisplay.js'; @@ -35,6 +36,8 @@ import { } from '../../config/footerItems.js'; import { isDevelopment } from '../../utils/installationInfo.js'; +const HOSTNAME = os.hostname(); + interface CwdIndicatorProps { targetDir: string; maxWidth: number; @@ -386,6 +389,15 @@ export const Footer: React.FC = () => { ); break; } + case 'hostname': { + addCol( + id, + header, + () => {HOSTNAME}, + HOSTNAME.length, + ); + break; + } case 'auth': { if (!settings.merged.ui.showUserIdentity) break; if (!authType) break; diff --git a/packages/cli/src/ui/components/FooterConfigDialog.test.tsx b/packages/cli/src/ui/components/FooterConfigDialog.test.tsx index 18b7c2a401..a2ba542cdd 100644 --- a/packages/cli/src/ui/components/FooterConfigDialog.test.tsx +++ b/packages/cli/src/ui/components/FooterConfigDialog.test.tsx @@ -116,7 +116,7 @@ describe('', () => { expect(lastFrame()).toContain('~/project/path'); // Move focus down to 'code-changes' (which has colored elements) - for (let i = 0; i < 9; i++) { + for (let i = 0; i < 10; i++) { act(() => { stdin.write('\u001b[B'); // Down arrow }); diff --git a/packages/cli/src/ui/components/FooterConfigDialog.tsx b/packages/cli/src/ui/components/FooterConfigDialog.tsx index e74b78de6f..10c4e71802 100644 --- a/packages/cli/src/ui/components/FooterConfigDialog.tsx +++ b/packages/cli/src/ui/components/FooterConfigDialog.tsx @@ -249,6 +249,9 @@ export const FooterConfigDialog: React.FC = ({ 'session-id': ( 769992f9 ), + hostname: ( + dev-machine + ), 'code-changes': ( diff --git a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-highlights-the-active-item-in-the-preview.snap.svg b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-highlights-the-active-item-in-the-preview.snap.svg index 9bc0920398..9362b2a8f9 100644 --- a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-highlights-the-active-item-in-the-preview.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-highlights-the-active-item-in-the-preview.snap.svg @@ -1,8 +1,8 @@ - + - + ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ @@ -75,91 +75,98 @@ [ ] - auth + hostname - Current authentication info + Current machine hostname - - > - - - [✓] - - code-changes - + [ ] + auth - - - Lines added/removed in the session (not shown when zero) - + Current authentication info - [ ] - token-count + + > + + + [✓] + + code-changes + - Total tokens used in the session (not shown when zero) + + + Lines added/removed in the session (not shown when zero) + - [✓] - Show footer labels + [ ] + token-count + Total tokens used in the session (not shown when zero) - Reset to default footer + [✓] + Show footer labels + Reset to default footer - Enter to select · ↑/↓ to navigate · ←/→ to reorder · Esc to close - ┌────────────────────────────────────────────────────────────────────────────────────────────┐ + Enter to select · ↑/↓ to navigate · ←/→ to reorder · Esc to close - - Preview: - - - workspace (/directory) - branch - sandbox - /model - quota - - diff - - + ┌────────────────────────────────────────────────────────────────────────────────────────────┐ - ~/project/path - main - docker - gemini-2.5-pro - 42% used - - +12 - - - -4 + Preview: - └────────────────────────────────────────────────────────────────────────────────────────────┘ + + workspace (/directory) + branch + sandbox + /model + quota + + diff + + + + ~/project/path + main + docker + gemini-2.5-pro + 42% used + + +12 + + + -4 + - ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ + + └────────────────────────────────────────────────────────────────────────────────────────────┘ + + + + ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-renders-correctly-with-default-settings.snap.svg b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-renders-correctly-with-default-settings.snap.svg index 518c7d138d..6539150367 100644 --- a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-renders-correctly-with-default-settings.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-renders-correctly-with-default-settings.snap.svg @@ -1,8 +1,8 @@ - + - + ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ @@ -84,77 +84,84 @@ [ ] - auth + hostname - Current authentication info + Current machine hostname [ ] - code-changes + auth - Lines added/removed in the session (not shown when zero) + Current authentication info [ ] - token-count + code-changes - Total tokens used in the session (not shown when zero) + Lines added/removed in the session (not shown when zero) - [✓] - Show footer labels + [ ] + token-count + Total tokens used in the session (not shown when zero) - Reset to default footer + [✓] + Show footer labels + Reset to default footer - Enter to select · ↑/↓ to navigate · ←/→ to reorder · Esc to close - ┌────────────────────────────────────────────────────────────────────────────────────────────┐ + Enter to select · ↑/↓ to navigate · ←/→ to reorder · Esc to close - - Preview: - - - - workspace (/directory) - branch - sandbox - /model - quota - + ┌────────────────────────────────────────────────────────────────────────────────────────────┐ - - ~/project/path - - main - docker - gemini-2.5-pro - 42% used + Preview: - └────────────────────────────────────────────────────────────────────────────────────────────┘ + + + workspace (/directory) + branch + sandbox + /model + quota + + + + ~/project/path + + main + docker + gemini-2.5-pro + 42% used + - ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ + + └────────────────────────────────────────────────────────────────────────────────────────────┘ + + + + ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-updates-the-preview-when-Show-footer-labels-is-toggled-off.snap.svg b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-updates-the-preview-when-Show-footer-labels-is-toggled-off.snap.svg index 6edd77b9e2..d19be17e27 100644 --- a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-updates-the-preview-when-Show-footer-labels-is-toggled-off.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog--FooterConfigDialog-updates-the-preview-when-Show-footer-labels-is-toggled-off.snap.svg @@ -1,8 +1,8 @@ - + - + ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ @@ -75,76 +75,83 @@ [ ] - auth + hostname - Current authentication info + Current machine hostname [ ] - code-changes + auth - Lines added/removed in the session (not shown when zero) + Current authentication info [ ] - token-count + code-changes - Total tokens used in the session (not shown when zero) + Lines added/removed in the session (not shown when zero) - - > - - [ ] - - Show footer labels - + token-count - + Total tokens used in the session (not shown when zero) - Reset to default footer + + > + + + [ ] + + Show footer labels + + + Reset to default footer - Enter to select · ↑/↓ to navigate · ←/→ to reorder · Esc to close - ┌────────────────────────────────────────────────────────────────────────────────────────────┐ + Enter to select · ↑/↓ to navigate · ←/→ to reorder · Esc to close - - Preview: - - - ~/project/path - · - main - · - docker - · - gemini-2.5-pro - · - 42% used - + ┌────────────────────────────────────────────────────────────────────────────────────────────┐ - └────────────────────────────────────────────────────────────────────────────────────────────┘ + + Preview: + + + ~/project/path + · + main + · + docker + · + gemini-2.5-pro + · + 42% used + - ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ + + └────────────────────────────────────────────────────────────────────────────────────────────┘ + + + + ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap index a703338771..452ae96d7c 100644 --- a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap @@ -23,6 +23,8 @@ exports[` > highlights the active item in the preview 1`] │ Memory used by the application │ │ [ ] session-id │ │ Unique identifier for the current session │ +│ [ ] hostname │ +│ Current machine hostname │ │ [ ] auth │ │ Current authentication info │ │ > [✓] code-changes │ @@ -68,6 +70,8 @@ exports[` > renders correctly with default settings 1`] = │ Memory used by the application │ │ [ ] session-id │ │ Unique identifier for the current session │ +│ [ ] hostname │ +│ Current machine hostname │ │ [ ] auth │ │ Current authentication info │ │ [ ] code-changes │ @@ -114,6 +118,8 @@ exports[` > renders correctly with default settings 2`] = │ Memory used by the application │ │ [ ] session-id │ │ Unique identifier for the current session │ +│ [ ] hostname │ +│ Current machine hostname │ │ [ ] auth │ │ Current authentication info │ │ [ ] code-changes │ @@ -159,6 +165,8 @@ exports[` > updates the preview when Show footer labels is │ Memory used by the application │ │ [ ] session-id │ │ Unique identifier for the current session │ +│ [ ] hostname │ +│ Current machine hostname │ │ [ ] auth │ │ Current authentication info │ │ [ ] code-changes │