Colors in neovim not shown

Hi all,
I just uploaded my first asciinema cast:
https://asciinema.org/a/zNLcS20lFtzuL0pDkVXPQwfc1

The problem is vim (neovim 0.4.3 to be accurate) is shown somewhat monochrome but it is not. The following screenshot shows the same source file how it has been recorded:

If I download the screencast and replay it locally (with asciinema play 333664.cast) the colors are back to normal, so I suppose the file has been uploaded properly.

Any hints?

asciinema recorder doesn’t capture actual colors, as there’s no easy, universal way for the application running inside a terminal to know this. It captures color numbers instead, which are then rendered in a browser according to the selected color theme. You can set the color theme for your asciinema.org account, or per recording.

Good news: asciinema 3.0 captures the original terminal colors. The final version hasn’t been released yet, but there’s release candidate you can try: Release v3.0.0-rc.1 · asciinema/asciinema · GitHub

That’s awesome :raised_hands:

In order to render the captured colours, do we need to use Release 3.7.2-rc.1 · asciinema/asciinema-player · GitHub or a later RC?

Edit: the answer is no, doesn’t appear to be supported yet

3.7.0 supports it. In order for it to use the original terminal colors you must not use theme option though.

In the upcoming 3.7.2 there will be "auto/dracula" syntax support for the theme option, which will automatically use original colors (if available), falling back to dracula (or any other named theme you specify).

Interesting, thanks for confirmation.

Is there anything that needs to be done to record it?

index.html · GitHub is how I’m looking to run it locally (no theme mentioned), having recorded that using:

% ~/Downloads/asciinema-x86_64-unknown-linux-gnu --version
asciinema 3.0.0-rc.1
% ~/Downloads/asciinema-x86_64-unknown-linux-gnu rec sql-workflow.new.json --overwrite

Interestingly in :point_up: I can’t see the theme object discovered so maybe it can’t autodetect?

Or is it that I need to post-process and add it?

If the theme field is not saved in the file then the CLI couldn’t auto-detect. This requires a terminal that supports color querying via OSC 4, OSC 10, OSC 11 control sequences.

What terminal do you use?

Interesting, I’m using kitty

I may have uploaded the wrong copy of the cast in my Gist (which I have now updated), now I’m seeing:

{"version":2,"width":45,"height":26,"timestamp":1718018728,"env":{"TERM":"xterm-kitty","SHELL":"/bin/zsh"},"theme":{"fg":"#fce8c3","bg":"#1c1b19","palette":"#1c1b19:#ef2f27:#519f50:#fbb829:#2c78bf:#e02c6d:#0aaeb3:#baa67f:#918175:#f75341:#98bc37:#fed06e:#68a8e4:#ff5c8f:#2be4d0:#fce8c3"}}

In the header of the cast, when using asciinema 3.0.0-rc.1

But with that detected theme in the header, I’m not seeing it render with "asciinema-player": "^3.7.2-rc.6"

I know what’s up. kitty is using a format of RGB color control sequence which is not yet supported by asciinema player.

This line here index.html · GitHub has \u001b[38:2:252:232:195m (with :) and asciinema player supports only \u001b[38;2;252;232;195m variant (with ;).

Luckily I have the fix almost ready, and I plan to release it within a couple of days.

1 Like

Hey @jamietanna, does this look correct?

Ooh yes @ku1ik yes it does :clap:t4:

Hey! I’ve just released v3.8.0 of the player, which includes support for colons in SGR params, solving your issue: Release 3.8.0 · asciinema/asciinema-player · GitHub

Thanks so much :purple_heart: that’s done it for me and I now see it working on my site (My workflow for writing SQL(ite) queries (2024 edition) · Jamie Tanna | Software Engineer)

1 Like

Nice! And I see your site is part of the IndieWeb Webring, cool!

1 Like