blessed icon indicating copy to clipboard operation
blessed copied to clipboard

Emojis break boxes [bug]

Open Kycermann opened this issue 2 years ago • 7 comments

Emojis seem to have double (?) the width of normal characters. This isn't accounted for in a box when using .pushLine.

│Test 🐢                        │
│                              │ 
│                              │                                                
│                              │                                                

Kycermann avatar May 22 '22 21:05 Kycermann

@Kycermann some emojis have two character lengths. You can see this by doing "🐢".length (output would be 2)

asnewman avatar Jun 15 '22 00:06 asnewman

That's true but they shouldn't distort the Blessed boxes they're in and at the moment they do

Kycermann avatar Jun 15 '22 11:06 Kycermann

@Kycermann This bug has been finally patched in a fork by kenan. here

p0ut avatar Feb 11 '23 21:02 p0ut

@p0ut awesome, seems like here doesn't have a link though

Kycermann avatar Feb 12 '23 13:02 Kycermann

@Kycermann Apologies, https://github.com/kenan238/reblessed

p0ut avatar Feb 13 '23 03:02 p0ut

@Kycermann So just a quick update so I don't mislead you, both myself and kenan are looking into the emoji issue. It is caused by the library not being able to detect the width of emoji's. Initially, we managed to 'semi-patch' such characters, however it still occurs on certain emoji's.

It seems that most character ranges are hard coded. We are doing our best to try to find a sufficient fix for this and I will keep you updated here.

p0ut avatar Feb 22 '23 06:02 p0ut

@p0ut cheers, I appreciate it!

Kycermann avatar Feb 22 '23 22:02 Kycermann