CLI:
Version: 1.7.3
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_LOG_DIR: unset
NO_COLOR: unset
TERM: "screen-256color"
JS_RUNTIME_VERSION: "v20.12.2"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "yarn/4.1.0"
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: false
VCS disabled: false
Workspace:
Open Documents: 0
When using the stdin mode in combination with β--colors off", some characters are displayed with broken characters.
I'm not a rustacean but have investigated the code.
The broken characters are Combining character which is represented by multiple code points.
fn main() {
println!("{}", "β οΈ".escape_unicode()); // \u{26a0}\u{fe0f}
println!("{}", "aΜ".escape_unicode()); // \u{61}\u{302}
println!("{}", "ο½ΆοΎ".escape_unicode()); // \u{ff76}\u{ff9e}
println!("{}", "π¨π»βπ¦±".escape_unicode()); // \u{1f468}\u{1f3fb}\u{200d}\u{1f9b1}
}
--colors off
or not using terminal will result in ColorChoice::Never
.
biome/crates/biome_console/src/lib.rs
Lines 94 to 114 in fec262f
If you run biome format
in stdin mode, the entire code is output here.
biome/crates/biome_cli/src/execute/std_in.rs
Lines 66 to 68 in fec262f
Finally, this write_str
is called.
In the write_str
method, convert characters in the case of Windows or ColorChoice::Never
.
By grapheme.chars().nth(0)
, all combining characters output only the first code point.
biome/crates/biome_console/src/write/termcolor.rs
Lines 167 to 173 in fec262f
The output of the code should not be converted anything.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too