unicode-display_width icon indicating copy to clipboard operation
unicode-display_width copied to clipboard

Print width of "\u{2E3A}" and "\u{2E3B}"

Open kuerbis opened this issue 2 years ago • 2 comments

As far as I can see*, the graphic character width of "\u{2E3A}" and "\u{2E3B}" are 2 and 3, but the print width in the terminal is 1.

#!/usr/bin/ruby

puts "|" + "-"        * 6 + "|||";
puts "|" + "\u{2E3B}" * 6 + "|||";
puts "|" + "\u{0bf8}" * 6 + "|||";

puts "\n";
puts "|" + "\u{2E3B}"  + " " * 3 + "|||";
puts "|" + "\u{0bf8}"  + " " * 3 + "|||";

* Deepin Terminal, GNOME-Terminal, Guake Terminal, Kitty, Konsole, LXTerminal, Sakura, Terminal, Terminator, Tilda, Xfce-Terminal, XTerm, Yakuake

kuerbis avatar Mar 30 '22 06:03 kuerbis

Hi @kuerbis, thanks for bringing this up. Do you have some more info / links on the different methods of measuring width (graphic width vs print width)? Seems to me like it is treated incorrectly by the terminal emulators, but I would like to know more about this.

janlelis avatar Jun 24 '22 13:06 janlelis

Hi, as far as I know there are three widths: 0, 1, and 2. On the other hand, I've noticed that there are some characters that don't fit in the spaces allotted to them from the terminal. That prompted me to look to see if these signs are such. Unfortunately I have no further information on this.

kuerbis avatar Jun 24 '22 17:06 kuerbis

Closing; should probably be fixed directly in the terminal emulators

janlelis avatar Jan 06 '23 10:01 janlelis