feat(cli): implement dynamic terminal tab titles for CLI status#16378
Conversation
Summary of ChangesHello @NTaylorMullen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience of the Gemini CLI by introducing dynamic terminal tab titles. These titles provide real-time status updates, such as whether the CLI is idle, actively working on a task, or requires user confirmation. This change allows users to quickly grasp the CLI's operational state at a glance from their OS taskbar or terminal tab list, improving workflow efficiency by reducing the need to constantly switch focus to the CLI window. The implementation includes a robust title computation logic, ensuring visual stability and clear communication of the CLI's status. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +2.69 kB (+0.01%) Total Size: 23 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces dynamic terminal tab titles, which is a great enhancement for user experience. The implementation is well-structured, centralizing the logic in computeTerminalTitle. However, I found a high-severity issue where the generated title can exceed the 80-character limit if the workspace folder name (or CLI_TITLE) is very long. This defeats the purpose of padding for visual stability. I've provided a suggestion to fix the truncation logic to ensure the title never exceeds 80 characters.
4b982ee to
48bc7c0
Compare
|
Review comments by Great implementation of dynamic terminal titles! This significantly improves the UX for monitoring the agent's state. I've identified a few areas where the implementation could better align with our project's testing and code quality standards: Testing Standards
Code and Configuration
Overall, the logic for |
- Introduces dynamic terminal titles based on CLI state (Ready: ◇, Action Required: ✋, Working: ✦). - Adds ui.dynamicWindowTitle setting (default: true) to toggle between dynamic and legacy titles. - Renames ui.showStatusInTitle label to 'Show Thoughts in Title' and updates its description for clarity. - Implements a 30-second delay before showing 'Action Required' for unfocused interactive shells. - Preserves folder suffix in title during working phase, dropping it only for long model thoughts. - Dynamically pads titles to 80 characters to prevent visual jitter in taskbars. - Updates tests, documentation, and settings schema. Fixes #16367
- Use custom waitFor in AppContainer tests - Add vi.restoreAllMocks() to afterEach blocks and fix mock reset in beforeEach - Refactor terminal title tests to use it.each - Regenerate docs/schemas to ensure consistency Fixes #16367
dcdeddf to
946c174
Compare
…cation and test structure - Implement truncate helper in windowTitle.ts to use Unicode ellipsis '…' - Move vi.useFakeTimers() and vi.useRealTimers() to beforeEach/afterEach in AppContainer.test.tsx - Update test expectations to match new ellipsis character Part of #16367
…les for CLI status (google-gemini#16378)

Implements dynamic terminal tab titles that reflect the current state of the Gemini CLI (Idle, Working, or Action Required). This allows users to monitor the agent's progress and know when their attention is required directly from their OS taskbar or terminal tab list without needing to focus the CLI window.
Every time it freezes is me clicking away from the tab (gif recording issue)
DynamicThoughtTitlesDemo.webm https://github.com/user-attachments/assets/d1ad1b37-28e1-4d1a-ac78-17424ff5f643
Details
• Dynamic State Mapping: Refactored
computeWindowTitleintocomputeTerminalTitleto takeStreamingStateand confirmation states as input.• Visual Stability: Titles are now padded to exactly 80 characters. This prevents visual jitter (icons shifting/resizing in taskbars or tab lists) as the title length changes.
• Default Setting: The
ui.showStatusInTitlesetting remains disabled by default (can be enabled via settings or config).• Prefixes: Uses standard project prefixes for visual consistency:
• Idle: ◇ Ready (workspace)
• Working: ✦ [Thought Subject] (workspace)
• Confirmation Needed: ✋ Action Required (workspace)
Updates from Code Review
waitForin tests.vi.restoreAllMocks()toafterEachblocks and ensured mocks are correctly reset inbeforeEach.it.eachfor better readability.ui.showStatusInTitledefault value isfalseand regenerated documentation.AppContainer.tsx.Related Issues
Fixes #16367
How to Validate
Pre-Merge Checklist
[✓] Updated relevant documentation and README (if needed)
[✓] Added/updated tests (if needed)
[✓] Noted breaking changes (if any)
[✓] Validated on MacOS