asciinema / asciinema-server

Platform for hosting and sharing terminal session recordings
https://docs.asciinema.org/manual/server/
Apache License 2.0
2.29k stars 263 forks source link

Using non-default terminal font prevents embedded playback element resize #422

Closed tvsbrent closed 8 months ago

tvsbrent commented 1 year ago

Describe the bug When using an embedded script with a terminal record whose font has been changed to "NerdFont" from the default font, resizing of the element does not work. The screenshot below shows the affected code:

image

When the font is to "NerdFont", the player variable's value is undefined on line 31, which causes an error when trying to add the resize event listener. When the font is set to default, this works properly, so apparently there is an async process that is has not completed and the player is unset when that code to add the event listener runs.

To Reproduce Steps to reproduce the behavior:

  1. Add a script tag like the following to a page:
    <script type="text/javascript" src="https://asciinema.org/a/{id}.js" id="asciicast-{id}" async></script>
  2. When viewing a terminal recording that is using the default font, it should load properly and resize the playback element.
  3. Change the recording to use "Nerd Font".
  4. The playback element will not resize.

Expected behavior The selection of a different font shouldn't prevent resizing the element from working.

Versions:

Additional context n/a

ku1ik commented 11 months ago

I believe this has been fixed via https://github.com/asciinema/asciinema-server/commit/db468494f67214628085e9783806c611c830fead

Please let me know if you still observe the bug.