-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console with emoji mess up the formatting #37904
Comments
I think if you somehow add a font with monospace emojies to your system, and let your terminal use this font, it will fix itself. |
I think it's actually an issue on how the block length is computed by SymfonyStyle. Actually updating Since the String component is required by |
Hey, thanks for your report! |
Not stale. |
…risson) This PR was submitted for the 5.x branch but it was merged into the 5.2 branch instead. Discussion ---------- [Console] fix emojis messing up the line width | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #37904 | License | MIT Description ======== The emojis, because they take as much space as two characters, would cause the console to display too many spaces to complete a line, which made it uneven, as described in the issue. The fix uses the `width` function instead of `strlen`. To answer @ogizanagi's comment, yes it does work with "composed" emojis. Before : ![image](https://user-images.githubusercontent.com/11477247/111832081-9d72b100-88f0-11eb-8eda-65ee480c898d.png) After : ![image](https://user-images.githubusercontent.com/11477247/111832103-a6638280-88f0-11eb-802e-838d97f61c81.png) Other changes ========== Removed two unused lines of code, the value of `$messageLineLength` was never used. Note ==== I'd like to add some tests, but I don't know how since I think this depends on console client width ? Thanks for your reviews 🙏 Commits ------- 36b36dc [Command] fix emojis messing up the line width
Underlying issue was fixed in Symfony: symfony/symfony#37904
Underlying issue was fixed in Symfony: symfony/symfony#37904
Symfony version(s) affected: 5.1.3
Description
Emoji mess up the formatting. The border is not even.
How to reproduce
Possible Solution
Something with string length count and encoding
Additional context
The text was updated successfully, but these errors were encountered: