-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Built-in echo behavior varies with different unicode notations of same character #1986
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
Comments
What happens if you pipe this into I am not saying that this is a bug in Git for Windows, because it is not, it is a bug in some component we bundle. I could imagine that the bug might be in ncurses, mintty, bash and/or echo. To route this bug to the appropriate bug tracker, we'll need to find out which component is at fault. |
I can kinda reproduce this on 2.20.1. I get this on Windows 8.1 and similar rendering on Windows 7.: What confused me a little though: How did you get from 2744 to E29D84EFB88F? A liitle digging [1][2] showed me the that the little snowflake should be UTF-8 encoded as E29D84. The resulting Piping to less does not change the rendering for me. My console font is set to Lucida Console. Manually setting the bash prompt with [1] https://stackoverflow.com/questions/602912/how-do-you-echo-a-4-digit-unicode-character-in-bash |
Piping to less didn't change the rendering for me either. My font is also While
Correct, just realized that I was using https://r12a.github.io/app-conversion/ tool in Firefox on Windows 10 and copied emoji character from https://emojipedia.org/snowflake/. Pasting in converter's textarea results in colorful image |
Okay, I think I start to understand what is going on there. The However, for some reason the But maybe you want to give it a try, @am11? In the meantime, you can use the fact that a simple space has the same width as half the snowflake: use export PS1=$'\e[1;94m\\t\e[0m:\e[1;36m\u2744 \e[0m \w \$ ' instead (i.e. append a space after |
Setup
v2.16.1(2)
defaults?
to the issue you're seeing?
I am using latest insider build of Windows 10 (last updatd 15.12.2018).
Details
Bash
Exception note: since
/bin/echo
and built-in (GNU) echo are different,/bin/echo.exe
doesn't understand\U
notations and echoes them literally even with escape interpretation-e
(e.g. try/bin/echo -e "\U2744"
thenecho -e "\U2744"
).All of the commands to print full-width Unicode 1.1 Snowflake character (U+2744): ❄️
Only
\U
notations display the full character,\x
and\0
are displayed partially:It seems like the built-in echo falls back on the behavior of
/bin/echo.exe
in case of hex\x
and octal\0
notations.Moreover, in
~/.bash_profile
, I am using\U
notation (which in my understanding/bin/echo.exe
doesn't interpret at all), yet:results in rendering of partial snowflake:
Seems like there is a third printer implementation, that does interpret
\U
notation but does not adjust the width of character like built-inecho -e '\U2744'
.The text was updated successfully, but these errors were encountered: