gum icon indicating copy to clipboard operation
gum copied to clipboard

:lady_beetle: Minor bug > misalignment issue on gum style with emojis

Open adriens opened this issue 2 years ago • 3 comments

When playing with the following code :

clear
gum style \
	--foreground 212 --border-foreground 212 --border double \
	--align center --width 50 --margin "1 2" --padding "2 4" \
	'📦 Colis-nc 📦' 'Suivre son colis avec RapidAPI et httpie'

I felt on a minor alignment bug (probably due to emoji) :

image

adriens avatar Jul 31 '22 22:07 adriens

I'm afraid this might be something we're not able to solve. Calculating emoji widths is to a certain degree guesswork, as we don't know

  1. the font your terminal is using
  2. how your terminal's cell rendering behaves with that specific font

As an example, this is how it looks on my system (Konsole):

image

Curious now tho: which terminal / platform are you experiencing this with?

muesli avatar Jul 31 '22 22:07 muesli

Calculating emoji widths is to a certain degree guesswork,

Indeed :sweat_smile:

:point_right: Looks perfectly clean on my local terminal too :

image

I could produce the bug on Killercoda :+1:

adriens avatar Jul 31 '22 23:07 adriens

This issue should probably tagged as a wontfix :thinking:

adriens avatar Jul 31 '22 23:07 adriens

Thanks @adriens for opening this issue! We should have a solution for this (better guess work in the future).

maaslalani avatar Aug 03 '22 01:08 maaslalani