Skip to content

bug(cli) fix flicker due to AppContainer continuous initialization#18958

Merged
jacob314 merged 1 commit intomainfrom
fix_flicker
Feb 12, 2026
Merged

bug(cli) fix flicker due to AppContainer continuous initialization#18958
jacob314 merged 1 commit intomainfrom
fix_flicker

Conversation

@jacob314
Copy link
Contributor

@jacob314 jacob314 commented Feb 12, 2026

Summary

  • Remove spuriously added terminal size listener that was causing AppContainer to be repeatedly initialized.

Related Issues

Fixes #18956

Will follow up with a regression test but Gemini struggled to create a proper one so reverted what it added as too much was mocked.

@jacob314 jacob314 requested a review from a team as a code owner February 12, 2026 21:41
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Feb 12, 2026

Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jacob314, 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 resolves a flickering issue within the application by eliminating an unnecessary re-initialization of the AppContainer component. The change specifically targets and removes a terminal size listener that was inadvertently triggering these re-initializations. To prevent future regressions, a new test has been introduced to validate that the AppContainer correctly maintains its state when the terminal dimensions are altered.

Highlights

  • Flicker Fix: Removed a terminal size listener that was causing the AppContainer to be repeatedly initialized, addressing a flickering issue.
  • Regression Test: Added a new regression test to ensure that the AppContainer does not unmount its state when the terminal size changes.
Changelog
  • packages/cli/src/gemini.tsx
    • Removed the import and usage of the useTerminalSize hook.
    • Removed the key prop from the AppContainer component that was dependent on terminal dimensions.
  • packages/cli/src/ui/AppContainer.test.tsx
    • Added a new test suite for 'Terminal Resize Behavior'.
    • Included a test case to assert that AppContainer state is not unmounted when the terminal size changes.
Activity
  • No human activity has been recorded on this pull request yet.
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.

@jacob314 jacob314 changed the title fix flicker bug(cli) fix flicker due to AppContainer continuous initialization Feb 12, 2026
Copy link
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 fixes a UI flicker issue that occurred on terminal resize. The root cause was correctly identified as the AppContainer component being re-mounted due to a changing key prop derived from the terminal dimensions. The fix removes this logic, preventing the re-mount and resolving the flicker. A regression test has been added to ensure AppContainer does not unmount on resize. I've provided a suggestion to improve the new test to more accurately simulate a terminal resize, making it a more robust regression guard.

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Size Change: -87 B (0%)

Total Size: 24.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.4 MB -87 B (0%)
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

@gemini-cli gemini-cli bot added priority/p0 Critical and urgent (e.g., critical security vulnerability, major breakage). area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 12, 2026
@jacob314 jacob314 enabled auto-merge February 12, 2026 21:50
@jacob314 jacob314 added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit c00de44 Feb 12, 2026
27 checks passed
@jacob314 jacob314 deleted the fix_flicker branch February 12, 2026 22:25
@Neinndall
Copy link

Neinndall commented Feb 13, 2026

@jacob314 I've updated the main repository and I'm testing it, and I think this fix messed up Gemini CLI. The terminal flickers occasionally, not always, but it's really annoying...

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 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. priority/p0 Critical and urgent (e.g., critical security vulnerability, major breakage).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppContainer is being incorrectly reinitialized

3 participants