-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
🐛 delta causes fancy unicode symbols such as Nerd Font Icons to be displayed as escaped in angle brackets #1616
Comments
Hi @vorburger, what encoding does the text use that you're sending to delta? delta currently only guarantees to correctly handle utf-8. (ref #188) |
@dandavison My git's output should be in UTF-8, based on this: $ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL= |
@dandavison actually, forget about guessing what encoding $ python3 -c 'print("\uF031")'
# Prints the "fancy" Font Symbol 'A'
$ python3 -c 'print("\uF031")' | less
<U+F031>
$ python3 -c 'print("\uF031")' | less --raw-control-chars
# Prints the "fancy" Font Symbol 'A'
$ python3 -c 'print("\uF031")' | delta
<U+F031> It looks like it's something particular with those special https://github.com/ryanoasis/nerd-fonts/ icon symbol Unicode Codepoints? Because a good ol' standard Smiley Emoji ☺(U+263A) works for me, check this out: $ python3 -c 'print("\u263A")'
☺
$ python3 -c 'print("\u263A")' | delta
☺
$ python3 -c 'print("\u263A")' | less
☺ |
I've run into the same issue with Nerd Fonts, but a bit surprisingly emoji work just fine. (I used them for the file labels.) |
Lines 132 to 134 in 5d538b2
@vorburger already figured out that you need to pass
Basically,
Notably, if you pass options to (edit: See @th1000s's reply below for the actually correct solution) |
Nice instructions @injust! If you ever feel like improving the manual or README in this area that would of course be fantastic also. |
Unfortunately, it turns out that (edit: See reply below for the actually correct solution) |
Nerd Fonts use the Private Use Area of Unicode, and
Setting this variable (unless already present) would restore the pre-633 behavior, especially since "there was a bug where only the two characters U+E000 and U+F8FF were treated as control characters [in prior less versions]". I think this could be done for all versions, older ones just ignore it. The open Nerd Fonts issue is Add documentation for "less" LESSUTFCHARDEF (Private Use Area characters definition) option: nerd-fonts/ryanoasis#1337. If Nerd Fonts mark double-width |
$ git clone https://github.com/vorburger/vorburger-dotfiles-bin-etc.git $ git checkout 975d4c977d41d8dd096067fa6d0588edee2c9fc7 $ ./fonts-install.sh $ git --no-pager log | head -12
Note the funky "font symbol" I've used in those 2 commit messages (the fancy 'A' - see it?), this is from https://github.com/ryanoasis/nerd-fonts/, which my
./fonts-install.sh
that's invoked above installed (if you then also appropriately configure to use that [patched!] Fira Code Nerd Font in your Terminal).Now check out what
delta
seems to do:So that "fancy" 'A' got replaced by
<U+F031>
- even though my (appropriately configured) Terminal could display it.Is there a way to configure
delta
to pass it through? For reference, check out this out for good ol'less
:so same, it also does this (unwanted) "escaping", but
less --raw-control-chars
does the trick:$ git --no-pager log | less --raw-control-chars
Of course, one would want to have the cake and eat it too, and still have fancy "ANSI coloring" as well... 😄
The text was updated successfully, but these errors were encountered: