Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ematipico
Copy link
Member

@ematipico ematipico commented Dec 9, 2025

Summary

Closes #2988

This PR was vibe-coded, since I don't know the subject very well. I asked Claude Code to write a breaking test first, then propose a solution.

Test Plan

Added new tests.

I also manually tested, e.g.

 echo "const s = '👨'" | cargo  biome-cli-dev check --stdin-file-path=file.js --colors force
 echo "const s = '👨'" | cargo  biome-cli-dev check --stdin-file-path=file.js --colors off 
 echo "const s = '👨'" | cargo  biome-cli-dev check --stdin-file-path=file.js

They all return const s = '👨'

Do those tests cover the issue? Please let me know if they don't

Docs

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: b7cde69

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the A-CLI Area: CLI label Dec 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Updates grapheme sanitisation in crates/biome_console/src/write/termcolor.rs to avoid truncating multi-codepoint grapheme clusters. On Windows, non-ASCII graphemes are still converted to ASCII; on non-Windows with colours disabled, multi-codepoint graphemes are preserved while single-codepoint symbols may be converted. Adds a changeset entry for a patch release and a test (test_preserve_multi_codepoint_graphemes_without_colors) covering preservation of multi-codepoint graphemes. Related to issue #2988.

Suggested reviewers

  • siketyan
  • mdevils

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing colors handling with multi-codepoint characters in stdin mode.
Description check ✅ Passed The description clearly relates to the changeset, referencing issue #2988, explaining the AI-assisted approach, and documenting manual testing performed.
Linked Issues check ✅ Passed The PR directly addresses issue #2988's core requirement: preserving full grapheme clusters when running in stdin mode with colors disabled, rather than stripping multi-codepoint characters.
Out of Scope Changes check ✅ Passed All changes are scoped to the termcolor write logic and directly relate to fixing multi-codepoint character handling in the console output module.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/terminal-color-emoji

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68b213f and b7cde69.

📒 Files selected for processing (2)
  • .changeset/rotten-results-yawn.md (1 hunks)
  • crates/biome_console/src/write/termcolor.rs (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/rotten-results-yawn.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_console/src/write/termcolor.rs

Comment @coderabbitai help to get the list of available commands and usage tips.

@ematipico ematipico marked this pull request as draft December 9, 2025 11:53
@ematipico ematipico force-pushed the fix/terminal-color-emoji branch from 68b213f to f423c7e Compare December 9, 2025 12:04
@ematipico ematipico marked this pull request as ready for review December 9, 2025 14:45
@ematipico ematipico requested review from a team December 9, 2025 14:46
@dyc3 dyc3 merged commit a21db74 into main Dec 17, 2025
13 checks passed
@dyc3 dyc3 deleted the fix/terminal-color-emoji branch December 17, 2025 13:24
@github-actions github-actions bot mentioned this pull request Dec 17, 2025
l0ngvh pushed a commit to l0ngvh/biome that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 biome breaks characters in stdin mode

3 participants