Open meredithmurfin opened 3 years ago
FYI: I'm facing the same issue on macOS when writing to the console using simple console.log
. What I hit was that I need to add two spaces after 🆚 and ✅ to display a single space, but not for ✳️ or 🆗.
So on one hand I don't think it is a cz-cli
issue, because had the same situation in a totally unrelated setup.
So far the common thing is that we are both using macOS, so it may be a macOS issue...
Update: Really looks like it is a terminal + Unicode specification issue, as Unicode marked some emojis single width, and terminals tend to respect that, but the indicated widths changed over time, so each terminal software may have slightly different view while most terminals at the same time give Emoji rendering to the OS to handle and most OS-es have defined all emojis look to be double width. So long story short, the terminal believes the specification, which is in itself inconsistent and has different versions, while the OS simply renders the double width emoji image regardless of how much space the terminal SW left out for it resulting in the look on the images in the issue opening description.
Best solution would be for all Terminal apps to decide to render all emojis as double width. It'd be far better than the current situation...
More info: https://github.com/unicode-rs/unicode-width/issues/4
Conclusion: probably out of scope for cz-cli
.
I believe this is an issue of xterm.js not handling Variation Selector-16, described here https://github.com/microsoft/vscode/issues/118905#issuecomment-1836842947
It is not a surprise that you also see this issue outside of xterm.js, only 7 of 23 terminals that I have tested with ucs-detect support all VS-16 sequences. Terminal.app does not support VS-16 sequences, but iTerm2 and kitty for MacOS do, so you might compare with those instead.
Issue
When I use Emojis in my .cz-config.js file to customize my commit messages, I see inconsistent spacing around specific Emojis. This is happening in both my VS Code terminal and my Mac OS terminal. I originally had issues with Emojis displaying correctly in VS Code files (you can see that issue here), but I believe this spacing issue stems from
commitizen
since it's happening outside of my VS Code.Check out my .cz-config.js file at the end of this issue so that you can see how the Emojis are being used for my commit messages. You will see that after every Emoji I have just 1 space between the Emoji and the next text.
No space shown after ⚙️
:gear:
and ♻️:recycle:
Emojis:No space shown after ⬇️
:arrow_down:
and 🛠️:hammer_and_wrench:
Emojis:No space shown after ✔️
:heavy_check_mark:
, ✏️:pencil2:
, and ⬆️:arrow_up:
Emojis:No space shown after 🏷️
:label:
Emoji:No space shown after 🖥️
:desktop_computer:
Emoji:The issue IS resolved when 2 spaces are added after Emojis, but I feel like this is a hacky fix and shouldn't be necessary
Project Information
This occurs in multiple projects. Each project I use this same setup:
devDependencies
:"@commitlint/cli": "^12.0.1"
"@commitlint/config-conventional": "^12.0.1"
"commitizen": "^4.2.3"
"cz-customizable": "^6.3.0"
config
is also in my package.json:module.exports = { extends: ['@commitlint/config-conventional'] };
My .cz-config.js