Skip to content

fix(cli): replace ambiguous width characters with halfwidth alternatives#26041

Closed
Ultron09 wants to merge 1 commit into
google-gemini:mainfrom
Ultron09:fix/ambiguous-chars
Closed

fix(cli): replace ambiguous width characters with halfwidth alternatives#26041
Ultron09 wants to merge 1 commit into
google-gemini:mainfrom
Ultron09:fix/ambiguous-chars

Conversation

@Ultron09

Copy link
Copy Markdown

This PR replaces several Unicode symbols (●, ▲, ■) used in the CLI UI with their halfwidth equivalents.

Some terminal emulators and fonts treat these characters as having ambiguous width, which can cause alignment issues and visual glitches (e.g., characters overlapping or being cut off) in the terminal display. Using halfwidth alternatives ensures consistent rendering across different terminal environments.

This change affects 126 files across the project where these symbols were used as indicators or UI elements.

Fixes #15585

@Ultron09 Ultron09 marked this pull request as ready for review April 27, 2026 11:05
@Ultron09 Ultron09 requested review from a team as code owners April 27, 2026 11:05
@github-actions

Copy link
Copy Markdown

🛑 Action Required: Evaluation Approval

Steering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged.

Maintainers:

  1. Go to the Workflow Run Summary.
  2. Click the yellow 'Review deployments' button.
  3. Select the 'eval-gate' environment and click 'Approve'.

Once approved, the evaluation results will be posted here automatically.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses visual alignment and rendering issues in the CLI interface caused by ambiguous-width Unicode characters. By substituting these characters with halfwidth alternatives, the project ensures a more stable and predictable display across different terminal environments, preventing common glitches like character overlapping or truncation.

Highlights

  • Unicode Symbol Replacement: Replaced ambiguous-width Unicode symbols (●, ▲, ■, →, ←) with halfwidth alternatives (∙, ▴, ∙, →, ←) to ensure consistent rendering and alignment across various terminal emulators.
  • Scope of Changes: The update was applied across 126 files, including source code, test files, and snapshot files, to maintain UI consistency.
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.

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.

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

Copy link
Copy Markdown
Contributor

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 replaces standard Unicode arrows and indicators with halfwidth variants across the CLI UI and core packages to improve terminal rendering consistency. Feedback was provided to revert these changes in strings specifically sent to the LLM, such as action paths and loop detection prompts, as using non-standard characters in prompts can negatively impact model reasoning and performance.

.map((p) => p.functionCall!.name) || [],
)
.join(' ');
.join(' ');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The use of the halfwidth arrow (U+FFEB) instead of the standard arrow (U+2192) in strings sent to the LLM (like the Action Path summary) is discouraged. While this change helps with terminal rendering consistency in the CLI, it can negatively impact the model's performance or reasoning, as is a much more common token in training data and is semantically standard for indicating transitions. Prompts and system notes sent to the model should prioritize standard Unicode characters over terminal-specific rendering fixes.

Suggested change
.join(' ');
.join(' ');

.map((p) => p.functionCall!.name) || [],
)
.join(' ');
.join(' ');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Standard arrows should be preserved in strings sent to the model. Terminal rendering concerns should not dictate the content of model prompts.

Suggested change
.join(' ');
.join(' ');


Specific patterns to look for:
- **Alternating cycles with no net effect:** The assistant cycles between the same actions (e.g., edit_file run_build edit_file run_build) where each iteration applies the same edit and encounters the same error, making zero progress. Note: alternating between actions is only a loop if the arguments and outcomes are substantively identical each cycle. If the assistant is modifying different code or getting different errors, that is debugging progress, not a loop.
- **Alternating cycles with no net effect:** The assistant cycles between the same actions (e.g., edit_file run_build edit_file run_build) where each iteration applies the same edit and encounters the same error, making zero progress. Note: alternating between actions is only a loop if the arguments and outcomes are substantively identical each cycle. If the assistant is modifying different code or getting different errors, that is debugging progress, not a loop.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This line is part of the LOOP_DETECTION_PROMPT sent to the LLM. Replacing the standard arrow with the halfwidth variant in model instructions is unnecessary and potentially detrimental to the model's understanding of the examples provided. Please revert this change for prompt strings.

Suggested change
- **Alternating cycles with no net effect:** The assistant cycles between the same actions (e.g., edit_file run_build edit_file run_build) where each iteration applies the same edit and encounters the same error, making zero progress. Note: alternating between actions is only a loop if the arguments and outcomes are substantively identical each cycle. If the assistant is modifying different code or getting different errors, that is debugging progress, not a loop.
- **Alternating cycles with no net effect:** The assistant cycles between the same actions (e.g., edit_file run_build edit_file run_build) where each iteration applies the same edit and encounters the same error, making zero progress. Note: alternating between actions is only a loop if the arguments and outcomes are substantively identical each cycle. If the assistant is modifying different code or getting different errors, that is debugging progress, not a loop.


expect(prompt).toContain('The Action Path:');
expect(prompt).toContain('tool_a tool_b');
expect(prompt).toContain('tool_a tool_b');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This test expectation should be reverted to use the standard arrow to match the suggested fix in the implementation, ensuring that prompts sent to the model remain standard.

Suggested change
expect(prompt).toContain('tool_a tool_b');
expect(prompt).toContain('tool_a tool_b');

@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Apr 27, 2026
@spencer426 spencer426 self-requested a review April 27, 2026 20:00
@spencer426

Copy link
Copy Markdown
Contributor

Thank you for your interest in contributing to the project! We are closing this PR as it currently does not meet the repository's contribution guidelines.

@spencer426 spencer426 closed this Apr 27, 2026
@sripasg sripasg added the size/l A large sized PR label Jun 2, 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 help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p1 Important and should be addressed in the near term. size/l A large sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid Ambiguous Width Characters

3 participants