asciinema / asciinema-player

Web player for terminal session recordings
Apache License 2.0
2.65k stars 261 forks source link

problem with brower version interpretation of multiview ncruses+UTF+ emoji #185

Open Popolon opened 2 years ago

Popolon commented 2 years ago

This record works perfectly in terminal, but not in browser (emoji made moving characters are not drawn at their place): https://asciinema.org/a/461817

This is based on an interactive C program using ncrses with several view + UTF (multibytes) characters including chinese (uniHan) + emoji characters.

Source code is available here: https://framagit.org/popolon/emohanjeu

normen commented 2 years ago

Emoji/UTFmultibyte in the terminal is a huge can of worms, this issue has been with asciinema for a long time now.

Popolon commented 2 years ago

asciinema plays them perfectly in term at least. On this asciideo (if I can say), I looks like only emoji are not at a good place, and shift in some cases other 2bytes UTF8 chars.

normen commented 2 years ago

In your term. Try another one :)

Popolon commented 2 years ago

Tried with several terminals, xfce4-term, terminator, lxterminal, xterm & uxterm (these two don't manage emoji font , and display squares inside, but still well formated), weston-terminal in weston displayed in an X11 windows (only squares, but well formated too), all worked fine at playing asccinema of this emoji+hanzi chars record. I made it caruflly with ncurses to have good term output.

Also tried on remote host with different architecture (ARM, RISC-V (both real hw and qemu)) via ssh, works fine too.

ku1ik commented 2 years ago

Indeed asciinema-player doesn't support double-width characters (which includes many emojis) at the moment. It's a known limitation. Hopefully we'll address it at some point although it's not a high priority issue.

yaojiqunaer commented 1 year ago

How I wish it could be restored

ku1ik commented 5 months ago

The recently released 3.7.1 version of the player got several improvements around rendering accuracy, mostly fixing positioning and alignment of various character groups (ascii drawing, block elements, Powerline symbols, CJK, emoji). It should look much better than before now.

The recording linked by @Popolon looks like this for me:

image

Is this more or less how it should look?

Popolon commented 5 months ago

There are still the same problem as soon the characters move sadly. You will see for exemple the character 森 (forest) in green that appear at some random position when the wolf head emoji character move inside the forest, or the right bar with a test reference with existing bg used characters that move after few second, but they are fix in a term, asciinema work fine in term.

You can compare the terminal and web version to see the differences. image

ku1ik commented 5 months ago

Got it, thanks for the clarification :+1:

BinaryRyan commented 1 month ago

Are you interested in fixing this issue?Not supporting multi byte text is a major bug.

ku1ik commented 1 month ago

@BinaryRyan What is specifically not working well for you? There's been some improvements to this in recent releases. Care to link to a demo that demonstrates the issue you're having?

BinaryRyan commented 1 month ago

well,we need to support internationalization in our project including chinese characters.

image

Actually, it's continuous. when I press 'backspace' terminal is inaccurate.