nerd-fonts icon indicating copy to clipboard operation
nerd-fonts copied to clipboard

Add documentation for "less" LESSUTFCHARDEF (Private Use Area characters definition) option

Open tkapias opened this issue 2 years ago • 12 comments
trafficstars

  • [x] I have searched the issues for my request and found nothing related and/or helpful
  • [x] I have searched the FAQ for help
  • [x] I have searched the Wiki for help

Issue

On Linux,less, the most common pager, will no longer print Private Use Area characters by default. I don't know when the transition took place, the version present in the Debian testing repositories (590) does still display Nerd-fonts characters, but the compiled master (633) no longer displays them.

A commit dated September 25, 2022 introduces a new option (LESSUTFCHARDEF) that allows you to declare the type of character display according to the code points range.

Using this option to declare code points listed in the wiki with the last version force less to display Nerd-fonts characters.

export LESSUTFCHARDEF=23fb-23fe:p,2665:p,26a1:p,2b58:p,e000-e00a:p,e0a0-e0a2:p,e0a3:p,e0b0-e0b3:p,e0b4-e0c8:p,e0ca:p,e0cc-e0d4:p,e200-e2a9:p,e300-e3e3:p,e5fa-e6a6:p,e700-e7c5:p,ea60-ebeb:p,f000-f2e0:p,f300-f32f:p,f400-f532:p,f500-fd46:p,f0001-f1af0:p

Solution

I think that instructions to export the correct variable should be given to Nerd-fonts users in the wiki or the readme.

Other

image

tkapias avatar Aug 13 '23 14:08 tkapias

Thanks for the fix!

I just spent an entire morning trying to pin-point the issue. I found this #1337 issue while looking for the code points used by Nerd Fonts.

For additional reference, I the version of less that introduced the LESSUTFCHARDEF is 632, more details are discussed in gwsw/less#275.

From what I understand of the linked issue PUA characters were never meant to be displayed. Maybe it has something to do with the v3 changes in Nerd Fonts?

acidghost avatar Aug 26 '23 12:08 acidghost

more is just more then less ;-D

After I took me years to switch from more to less I probably will switch back ;-)

image

I will try to come up with a documentation change. Thank you both very much!! :medal_sports:

Finii avatar Sep 22 '23 18:09 Finii

Can you assign me this issue?

Cyb3rGhoul avatar Oct 15 '23 16:10 Cyb3rGhoul

@Cyb3rGhoul Of course, thank you

Finii avatar Oct 16 '23 07:10 Finii

Here is value suitable for Nerd Fonts v3.2.1 non-Mono version (with nice double width large icons :smile:):

LESSUTFCHARDEF=23fb-23fe:w,2665-2665:w,2b58-2b58:w,e000-e00a:w,e0a0-e0a3:p,e0b0-e0bf:p,e0c0-e0c8:w,e0ca-e0ca:w,e0cc-e0d7:w,e200-e2a9:w,e300-e3e3:w,e5fa-e6b5:w,e700-e7c5:w,ea60-ec1e:w,ed00-efce:w,f000-f2ff:w,f300-f375:w,f400-f533:w,f0001-f1af0:w

Mono version will needs the same value with all :w replaced by :p.

powerman avatar Jul 09 '24 17:07 powerman

Here is value suitable for Nerd Fonts v3.2.1 non-Mono version (with nice double width large icons 😄):

LESSUTFCHARDEF=23fb-23fe:w,2665-2665:w,2b58-2b58:w,e000-e00a:w,e0a0-e0a3:p,e0b0-e0bf:p,e0a0-e0c8:w,e0ca-e0ca:w,e0cc-e0d7:w,e200-e2a9:w,e300-e3e3:w,e5fa-e6b5:w,e700-e7c5:w,ea60-ec1e:w,ed00-efce:w,f000-f2ff:w,f300-f375:w,f400-f533:w,f0001-f1af0:w

Mono version will needs the same value with all :w replaced by :p.

How is this value generated? I'm not sure how to tell which code points are double-width.

Also, I think e0a0-e0c8:w overlaps with e0a0-e0a3:p and e0b0-e0bf:p?

injust avatar Jul 10 '24 12:07 injust

How is this value generated? I'm not sure how to tell which code points are double-width.

Manually. :disappointed:

Also, I think e0a0-e0c8:w overlaps with e0a0-e0a3:p and e0b0-e0bf:p?

Yeah, sorry, it was a typo I have already fixed somewhere else but missed to fix here: it should be e0c0-e0c8:w (just fixed in my original comment).

powerman avatar Jul 10 '24 14:07 powerman

According to https://github.com/gwsw/less/blob/v661/less.nro.VER#L2015-L2017, the code point ranges can also be single code points. It's probably clearer to do that for 2665, 2b58, and e0ca, which results in:

LESSUTFCHARDEF=23fb-23fe:w,2665:w,2b58:w,e000-e00a:w,e0a0-e0a3:p,e0b0-e0bf:p,e0c0-e0c8:w,e0ca:w,e0cc-e0d7:w,e200-e2a9:w,e300-e3e3:w,e5fa-e6b5:w,e700-e7c5:w,ea60-ec1e:w,ed00-efce:w,f000-f2ff:w,f300-f375:w,f400-f533:w,f0001-f1af0:w

injust avatar Jul 10 '24 14:07 injust