Skip to content

feat(cli): implement dynamic terminal tab titles for CLI status#16378

Merged
NTaylorMullen merged 3 commits into
mainfrom
ntm/gh.16367
Jan 13, 2026
Merged

feat(cli): implement dynamic terminal tab titles for CLI status#16378
NTaylorMullen merged 3 commits into
mainfrom
ntm/gh.16367

Conversation

@NTaylorMullen
Copy link
Copy Markdown
Collaborator

@NTaylorMullen NTaylorMullen commented Jan 12, 2026

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 computeWindowTitle into computeTerminalTitle to take StreamingState and 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.showStatusInTitle setting 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

  • Switched to custom waitFor in tests.
  • Added vi.restoreAllMocks() to afterEach blocks and ensured mocks are correctly reset in beforeEach.
  • Refactored terminal title tests to use it.each for better readability.
  • Confirmed ui.showStatusInTitle default value is false and regenerated documentation.
  • Rebased on latest main and resolved conflicts in AppContainer.tsx.

Related Issues

Fixes #16367

How to Validate

  1. Run the CLI in a terminal with visible tabs (e.g. iTerm2, macOS Terminal).
  2. Observe the initial title: ◇ Ready (gemini-cli3).
  3. Give the CLI a long-running task (e.g. "Count from 1 to 50 slowly").
  4. Observe the tab title change to ✦ [Subject] (gemini-cli3).
  5. Trigger a command that requires shell confirmation (e.g. "Run git log").
  6. Observe the tab title change to ✋ Action Required (gemini-cli3) while waiting for your approval.

Pre-Merge Checklist

[✓] Updated relevant documentation and README (if needed)
[✓] Added/updated tests (if needed)
[✓] Noted breaking changes (if any)
[✓] Validated on MacOS

@NTaylorMullen NTaylorMullen requested a review from a team as a code owner January 12, 2026 00:23
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Dynamic Terminal Tab Titles: The CLI now dynamically updates terminal tab titles to reflect its current state: Idle, Working, or Action Required. This allows users to monitor the agent's progress and know when their attention is required without focusing the CLI window.
  • Refactored Title Computation: The computeWindowTitle function has been refactored and renamed to computeTerminalTitle. It now takes StreamingState and confirmation states as input to generate more descriptive titles.
  • Visual Stability: All terminal titles are now padded to a fixed length of 80 characters. This prevents visual jitter, such as icons shifting or resizing in taskbars or tab lists, as the title length changes.
  • Default Setting Change: The ui.showStatusInTitle setting, which controls whether the CLI status is shown in the terminal title, is now enabled by default.
  • Standardized Prefixes: New, visually consistent prefixes have been introduced for different states: ◇ Ready for Idle, ✦ [Thought Subject] for Working, and ✋ Action Required for when confirmation is needed.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 12, 2026

Size Change: +2.69 kB (+0.01%)

Total Size: 23 MB

Filename Size Change
./bundle/gemini.js 23 MB +2.69 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/cli/src/utils/windowTitle.ts
@gemini-cli gemini-cli Bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Jan 12, 2026
@NTaylorMullen NTaylorMullen force-pushed the ntm/gh.16367 branch 2 times, most recently from 4b982ee to 48bc7c0 Compare January 12, 2026 01:38
@jacob314 jacob314 self-requested a review January 12, 2026 23:16
@jacob314
Copy link
Copy Markdown
Contributor

Review comments by /review-frontend after manual review by Jacob.

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

  • Use custom waitFor: In packages/cli/src/ui/AppContainer.test.tsx, the test at line 1274 uses vi.waitFor. Please switch to our custom waitFor from packages/cli/src/test-utils/async.ts to ensure compatibility with act() and prevent flakiness.
  • Snapshot Testing: Many of the new tests for terminal titles (in both AppContainer.test.tsx and windowTitle.test.ts) use raw string matching (toBe, toContain). We prefer using toMatchSnapshot() to verify rendering-related output to ensure consistency and catch regressions more effectively.
  • Mock Management: Please add vi.restoreAllMocks() to the afterEach blocks in AppContainer.test.tsx to prevent mock state from leaking between tests, as per our internal guidelines.
  • Parameterized Tests: packages/cli/src/utils/windowTitle.test.ts is quite repetitive. Consider refactoring these into a parameterized test using it.each to reduce boilerplate and improve readability.

Code and Configuration

  • Default Setting Consistency: The PR description mentioned that ui.showStatusInTitle is now enabled by default, but the change in settingsSchema.ts still has it set to false. Could you clarify if this was intentional or if the default should be updated?

Overall, the logic for computeTerminalTitle is very robust and well-handled!

- 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
Comment thread docs/cli/settings.md
Comment thread packages/cli/src/ui/AppContainer.test.tsx Outdated
Comment thread packages/cli/src/utils/windowTitle.ts
Copy link
Copy Markdown
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm
Approved with a couple minor comments.

@jacob314 jacob314 disabled auto-merge January 13, 2026 00:42
…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
@NTaylorMullen NTaylorMullen added this pull request to the merge queue Jan 13, 2026
Merged via the queue into main with commit 2fc6168 Jan 13, 2026
26 checks passed
@NTaylorMullen NTaylorMullen deleted the ntm/gh.16367 branch January 13, 2026 01:27
thacio added a commit to thacio/auditaria that referenced this pull request Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Dynamic Terminal Tab Titles for CLI Status

3 participants