asciinema / asciinema

Terminal session recorder 📹
https://asciinema.org
GNU General Public License v3.0
14.02k stars 909 forks source link

Error: Terminal does not support reporting screen sizes in pixels #591

Open ju1ius opened 10 months ago

ju1ius commented 10 months ago

Describe the bug

Using the kitty terminal, running the icat kitten to display images causes the following error:

Error: Terminal does not support reporting screen sizes in pixels,
use a terminal such as kitty, WezTerm, Konsole, etc. that does.

Steps to Reproduce

  1. Run the kitty terminal
  2. Start a new asciinema recording: asciinema rec /path/to/file.cast
  3. Try to display an image by running kitten icat /path/to/some/image.png
  4. See error

Expected behavior

The image should show correctly. In addition, the error message is confusing since I'm actually using a terminal that «supports reporting screen sizes in pixels».

Versions:

Additional context:

Here's the cast: ```json {"version": 2, "width": 98, "height": 28, "timestamp": 1700476942, "env": {"SHELL": "/bin/bash", "TERM": "xterm-kitty"}} [0.24583, "o", "\u001b[?2004h\u001b[1;36m~/tmp/demo\u001b[0m \r\n\u001b[90m➜\u001b[0m "] [1.808961, "o", "k"] [2.042065, "o", "i"] [2.214341, "o", "t"] [2.386478, "o", "t"] [2.607982, "o", "e"] [2.833577, "o", "n"] [3.127023, "o", " "] [3.38527, "o", "i"] [3.604812, "o", "c"] [3.833219, "o", "a"] [4.040119, "o", "t"] [4.523513, "o", " "] [5.052099, "o", "~"] [5.580483, "o", "/"] [6.179512, "o", "i"] [6.277611, "o", "m"] [6.445922, "o", "g"] [6.995226, "o", "/"] [7.408386, "o", "m"] [7.56524, "o", "a"] [7.792798, "o", "o"] [8.261278, "o", "."] [8.584539, "o", "p"] [8.841456, "o", "n"] [8.961138, "o", "g"] [9.730059, "o", "\r\n\u001b[?2004l\r"] [9.764596, "o", "\u001b[1;91mError\u001b[221;39m: Terminal does not support reporting screen sizes in pixels, use a terminal such as kitty, WezTerm, Konsole, etc. that does.\r\n"] [9.868469, "o", "\u001b[?2004h\u001b[1;36m~/tmp/demo\u001b[0m \r\n\u001b[31m✖\u001b[0m "] [10.904578, "o", "\u001b[?2004l\r\r\nexit\r\n"] ```
ku1ik commented 8 months ago

I tested this with the latest version from develop, which is a new Rust codebase, and it seems to work. This new implementation will be released as 3.0, but I have no ETA at the moment.

ku1ik commented 8 months ago

If you'd like to test the beta of 3.0 check the instructions here: https://discourse.asciinema.org/t/testing-the-new-rust-version-of-the-asciinema-cli/778

ku1ik commented 5 months ago

Can you verify this problem has been fixed in 3.0? You can get a pre-release build of 3.0 here: https://github.com/asciinema/asciinema/releases/tag/v3.0.0-rc.1

lunrenyi commented 1 month ago

@ku1ik The issue has not been resolved

  1. No anomalies or errors were found during the recording of the kitten icat command using asciinema rec.
  2. During the playback of the generated cast file using asciinema play, I found that it cannot display the image shown by kitten icat, and the cast file does not record any image-related content.
asciinema rec a.cast
kitten icat rg.png
exit

asciinema play a.cast

asciinema v3.0.0-rc.3 kitty 0.35.2

By the way, when will asciinema v3.0.0 be officially released?

ku1ik commented 1 month ago

Right, asciinema doesn't record image data sent via kitty image protocol, and the player doesn't support image display.

This is not planned currently.

ku1ik commented 1 month ago

Re the release of final 3.0 - I want to do one or two more things before I release it, but I'm currently involved in consulting work, and will probably get back to this in 1-2 months.