[GH-ISSUE #124] positioning weirdness? #706

Closed
opened 2026-03-15 08:57:54 +03:00 by kerem · 1 comment
Owner

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)

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)
kerem closed this issue 2026-03-15 08:57:59 +03:00
Author
Owner

@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.

<!-- gh-comment-id:130568772 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#706
No description provided.