Skip to content

The asciicast header omits timestamp and title, so a recording has no date in any player #309

Description

@vyncint

TodayRecording::to_asciicast writes a v2 header with four keys. Measured on 0.10.1 in crates/termlens/src/terminal.rs, the format string carries only version, width, height and env. The asciicast v2 spec also defines optional timestamp (unix seconds), duration and title; none is emitted, so asciinema and the web player show a recording with no date and no name.

Why it is worth fixing — these files get attached to bug reports and CI artifacts, where "which run was this?" is the first question asked. It is three optional keys in a header the code already builds.

Fix — add timestamp (from SystemTime::now() at export, seconds since the epoch) and title in crates/termlens/src/terminal.rs. The honest source for the title is the command the terminal spawned, which Terminal already keeps as command_desc — thread it onto Recording when stop() builds it. duration pairs naturally with #307; leaving it out is fine.

Done when

  • The header carries timestamp and title and stays valid JSON on one line.
  • crates/termlens/tests/record.rs parses the header and asserts both keys.
  • The output still plays under asciinema play.

A good first contribution: one file, no architecture decisions. Start with
CONTRIBUTING.md
— §1 lists every gate you can run locally, and §3 asks that a change land
with a test. Commits are Conventional Commits and need git commit -s
(DCO). Happy to review a draft PR early.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions