[PR #341] [MERGED] Breakpoints #437

Closed
opened 2026-02-25 20:33:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/341
Author: @ku1ik
Created: 3/17/2019
Status: Merged
Merged: 4/28/2023
Merged by: @ku1ik

Base: developHead: feature/breakpoints


📝 Commits (10+)

  • f25f9d6 Document "b" (breakpoint) event type
  • 5b24513 Add breakpoints
  • 3c308f4 Add integration test for breakpoints
  • 3c718cf Remove unused function arg
  • e0745a8 Simplify player loop
  • f06e4a0 Catch IOError only when openning /dev/tty for playback
  • c46712a Auto-pause on breakpoints during playback
  • f102822 Add --breakpoints option to asciinema play to opt-in for pausing on breakpoints
  • b0653ec Document breakpoints
  • f284740 Refactor player loop

📊 Changes

12 files changed (+167 additions, -43 deletions)

View changed files

📝 README.md (+36 -2)
📝 asciinema/__main__.py (+7 -0)
📝 asciinema/asciicast/raw.py (+3 -0)
📝 asciinema/asciicast/v2.py (+3 -0)
📝 asciinema/commands/play.py (+3 -0)
📝 asciinema/commands/record.py (+1 -0)
📝 asciinema/config.py (+8 -0)
📝 asciinema/player.py (+69 -38)
📝 asciinema/pty_.py (+9 -1)
📝 asciinema/recorder.py (+5 -0)
📝 doc/asciicast-v2.md (+14 -2)
📝 tests/integration.sh (+9 -0)

📄 Description

This one adds breakpoints - locations in the recording which allow the player to auto-pause when one is encountered.

A breakpoint is new "b" event type in asciicast stream, with optional annotation (comment) as event data.

To add a breakpoint during recording session press a hotkey (specified in config file as add_breakpoint_key).

To add breakpoints to existing recording you add "b" events like this:

...
[1.000000, "o", "some text"]
[2.500000, "b", ""]
[3.750000, "o", "more text"]
[4.500000, "b", "chapter 5"]
...
  • support for breakpoints in asciicast v2 event stream
  • setting breakpoint during recording session via hotkey
  • documentation
  • find good default hotkey, and/or hotkey prefix (like GNU screen, tmux) no default for now
  • implement pause-on-breakpoint mode for asciinema play command (opt-in with -b/--breakpoints switch)
  • jump to next breakpoint during asciinema play with hotkey (])
  • add test

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/341 **Author:** [@ku1ik](https://github.com/ku1ik) **Created:** 3/17/2019 **Status:** ✅ Merged **Merged:** 4/28/2023 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `develop` ← **Head:** `feature/breakpoints` --- ### 📝 Commits (10+) - [`f25f9d6`](https://github.com/asciinema/asciinema/commit/f25f9d6e8b97bd87a1704fa7c3604634a9848fb6) Document "b" (breakpoint) event type - [`5b24513`](https://github.com/asciinema/asciinema/commit/5b24513c2f874a8b8aa9a32606804ee9a2dbf853) Add breakpoints - [`3c308f4`](https://github.com/asciinema/asciinema/commit/3c308f413a4918600ab0ebb06cf3ab9512a1b4b9) Add integration test for breakpoints - [`3c718cf`](https://github.com/asciinema/asciinema/commit/3c718cf8cbde300e550d9edeea663beececc1bf3) Remove unused function arg - [`e0745a8`](https://github.com/asciinema/asciinema/commit/e0745a8d5a3f49358438c51c3c7fa4c156726bdb) Simplify player loop - [`f06e4a0`](https://github.com/asciinema/asciinema/commit/f06e4a09406dabfdaee9ddae342e8aea56345243) Catch IOError only when openning /dev/tty for playback - [`c46712a`](https://github.com/asciinema/asciinema/commit/c46712a72b782850d0c8dbc187005e14cd2fe797) Auto-pause on breakpoints during playback - [`f102822`](https://github.com/asciinema/asciinema/commit/f102822e2931885ea6a8babbe837bfa4b8c33554) Add `--breakpoints` option to `asciinema play` to opt-in for pausing on breakpoints - [`b0653ec`](https://github.com/asciinema/asciinema/commit/b0653ec86ec6fb9d3f984a9d61f585a25358d205) Document breakpoints - [`f284740`](https://github.com/asciinema/asciinema/commit/f2847409ee2e9c3468c819408ab9137bad519afc) Refactor player loop ### 📊 Changes **12 files changed** (+167 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+36 -2) 📝 `asciinema/__main__.py` (+7 -0) 📝 `asciinema/asciicast/raw.py` (+3 -0) 📝 `asciinema/asciicast/v2.py` (+3 -0) 📝 `asciinema/commands/play.py` (+3 -0) 📝 `asciinema/commands/record.py` (+1 -0) 📝 `asciinema/config.py` (+8 -0) 📝 `asciinema/player.py` (+69 -38) 📝 `asciinema/pty_.py` (+9 -1) 📝 `asciinema/recorder.py` (+5 -0) 📝 `doc/asciicast-v2.md` (+14 -2) 📝 `tests/integration.sh` (+9 -0) </details> ### 📄 Description This one adds breakpoints - locations in the recording which allow the player to auto-pause when one is encountered. A breakpoint is new `"b"` event type in asciicast stream, with optional annotation (comment) as event data. To add a breakpoint during recording session press a hotkey (specified in config file as `add_breakpoint_key`). To add breakpoints to existing recording you add `"b"` events like this: ``` ... [1.000000, "o", "some text"] [2.500000, "b", ""] [3.750000, "o", "more text"] [4.500000, "b", "chapter 5"] ... ``` - [x] support for breakpoints in asciicast v2 event stream - [x] setting breakpoint during recording session via hotkey - [x] documentation - [x] ~~find good default hotkey, and/or hotkey prefix (like GNU screen, tmux)~~ no default for now - [x] implement pause-on-breakpoint mode for `asciinema play` command (opt-in with `-b/--breakpoints` switch) - [x] jump to next breakpoint during `asciinema play` with hotkey (`]`) - [x] add test --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 20:33:44 +03:00
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#437
No description provided.