mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 07:55:51 +03:00
[GH-ISSUE #124] positioning weirdness? #706
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#706
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jbenet on GitHub (Aug 13, 2015).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/124
See the positioning weirdness in this asciinema: https://asciinema.org/a/5mu1809wf8socszrxzk9bfvlv -- the terminal shows it correctly. (It's made with https://github.com/jpillora/ssh-tron)
@ku1ik commented on GitHub (Aug 13, 2015):
Haha, this looks very funny :)
The thing here is that web browsers don't always use the same width for monospace characters, contrary to what you may expect. For example, empty screen cell (represented by space character) can be 8 pixels wide, but the "⣤" character may be 7 pixels wide. That's why when something is drawn on the left all the characters on the right move right/left.
The player presents all terminal lines as span elements, grouping text with the same color attributes in the same span element. The only way to overcome the mentioned problem would be to use a table or render each single character in its own, fixed width span. That would make thousands of DOM elements, which could make it slower, and possibly it would not play well with copy-paste.
Also, see here: https://stackoverflow.com/questions/9351689/how-to-display-special-unicode-characters-using-monospace-font-in-html-with-pres
I welcome any suggestions for solving it.