[PR #340] [MERGED] Pause/resume recording #1050

Closed
opened 2026-03-15 11:15:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/340
Author: @ku1ik
Created: 3/17/2019
Status: Merged
Merged: 3/30/2019
Merged by: @ku1ik

Base: developHead: feature/muting


📝 Commits (10+)

  • 8aecc1d Let pty recorder report elapsed time
  • 13bb071 Pass append instead of mode to all writer types
  • 8e29f97 Don't overwrite buffering mode in async writer level
  • 2d27db2 Refactor v2 writer
  • b9ece31 Move recording details to new recorder module
  • 7af03d8 Handle time offset in pty.record instead of in writer
  • 9cfc1d2 Mute recording with ctrl+p
  • 9e9df3a Document muting
  • 41feced pycodestyle
  • 0ba174b "Pausing" is better than "muting"

📊 Changes

12 files changed (+246 additions, -165 deletions)

View changed files

📝 .travis.yml (+1 -1)
📝 README.md (+5 -0)
📝 asciinema/__init__.py (+13 -46)
📝 asciinema/asciicast/raw.py (+9 -23)
📝 asciinema/asciicast/v2.py (+19 -85)
asciinema/async_worker.py (+31 -0)
📝 asciinema/commands/record.py (+3 -3)
asciinema/notifier.py (+31 -0)
📝 asciinema/pty.py (+28 -5)
asciinema/recorder.py (+99 -0)
📝 man/asciinema.1.md (+5 -0)
📝 tests/pty_test.py (+2 -2)

📄 Description

This one adds recording pausing/resuming functionality, that can be used to temporarily turn off capturing of stdout/stdin by pressing a hotkey. This is useful when you want to execute commands during the recording session that should not be captured (e.g. pasting secrets).

Similarly to #341, the hotkey for toggling pause is hard-coded at the moment to ctrl+p ("p" for "pause capture"), but it is very likely to conflict with many interactive applications (e.g. vim), so we may want to find a better one, or go with a prefix + key (like ctrl+a <key> in screen, ctrl+b <key> in tmux).

It may be a good idea to show a notification that pause/resume actually happened after pressing a hotkey. Printing something to the terminal is not a good idea here, since it would potentially overwrite whatever was printed before (in fullscreen apps like vim), so I believe an external tool is the best choice. We could have a setting in a config file notification_command which would be invoked to notify about pause/resume (also about setting breakpoint in #341). You could then set it to show the notification in tmux's status bar (via tmux display-message) or show a desktop notification (notify-send, Growl, etc) or play a sound.

  • toggle pause during recording session via hotkey
  • stop time when paused
  • documentation
  • notifications
  • find good default hotkey, and/or hotkey prefix (like GNU screen, tmux)

🔄 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/340 **Author:** [@ku1ik](https://github.com/ku1ik) **Created:** 3/17/2019 **Status:** ✅ Merged **Merged:** 3/30/2019 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `develop` ← **Head:** `feature/muting` --- ### 📝 Commits (10+) - [`8aecc1d`](https://github.com/asciinema/asciinema/commit/8aecc1d55824b50cdc9c932436ee5a9b6311d5c6) Let pty recorder report elapsed time - [`13bb071`](https://github.com/asciinema/asciinema/commit/13bb071d85247430f9f28fe99b3729f3c18a7d7e) Pass `append` instead of mode to all writer types - [`8e29f97`](https://github.com/asciinema/asciinema/commit/8e29f975d2032b236978c6adfa79a403b203655d) Don't overwrite buffering mode in async writer level - [`2d27db2`](https://github.com/asciinema/asciinema/commit/2d27db20dcf8a18a0635e1ec794daf856bdb6c02) Refactor v2 writer - [`b9ece31`](https://github.com/asciinema/asciinema/commit/b9ece310a36dfe62680bde5223396f4b8b1a6168) Move recording details to new `recorder` module - [`7af03d8`](https://github.com/asciinema/asciinema/commit/7af03d8a184c6d7f22e039c63361c0afb0b5a12c) Handle time offset in pty.record instead of in writer - [`9cfc1d2`](https://github.com/asciinema/asciinema/commit/9cfc1d2a62d5e9ca2556ec6c0cb92aebd20b6ceb) Mute recording with ctrl+p - [`9e9df3a`](https://github.com/asciinema/asciinema/commit/9e9df3a50c480a4af08c2b7753edf28ca6096fc3) Document muting - [`41feced`](https://github.com/asciinema/asciinema/commit/41feced9b9db31d655690f0c7d9735409e46352e) pycodestyle - [`0ba174b`](https://github.com/asciinema/asciinema/commit/0ba174b0d282afe55b5f6082ab8ba159e4031a9d) "Pausing" is better than "muting" ### 📊 Changes **12 files changed** (+246 additions, -165 deletions) <details> <summary>View changed files</summary> 📝 `.travis.yml` (+1 -1) 📝 `README.md` (+5 -0) 📝 `asciinema/__init__.py` (+13 -46) 📝 `asciinema/asciicast/raw.py` (+9 -23) 📝 `asciinema/asciicast/v2.py` (+19 -85) ➕ `asciinema/async_worker.py` (+31 -0) 📝 `asciinema/commands/record.py` (+3 -3) ➕ `asciinema/notifier.py` (+31 -0) 📝 `asciinema/pty.py` (+28 -5) ➕ `asciinema/recorder.py` (+99 -0) 📝 `man/asciinema.1.md` (+5 -0) 📝 `tests/pty_test.py` (+2 -2) </details> ### 📄 Description This one adds recording pausing/resuming functionality, that can be used to temporarily turn off capturing of stdout/stdin by pressing a hotkey. This is useful when you want to execute commands during the recording session that should not be captured (e.g. pasting secrets). Similarly to #341, the hotkey for toggling pause is hard-coded at the moment to `ctrl+p` ("p" for "pause capture"), but it is very likely to conflict with many interactive applications (e.g. vim), so we may want to find a better one, or go with a prefix + key (like `ctrl+a <key>` in `screen`, `ctrl+b <key>` in `tmux`). It may be a good idea to show a notification that pause/resume actually happened after pressing a hotkey. Printing something to the terminal is not a good idea here, since it would potentially overwrite whatever was printed before (in fullscreen apps like vim), so I believe an external tool is the best choice. We could have a setting in a config file `notification_command` which would be invoked to notify about pause/resume (also about setting breakpoint in #341). You could then set it to show the notification in tmux's status bar (via `tmux display-message`) or show a desktop notification (`notify-send`, Growl, etc) or play a sound. - [x] toggle pause during recording session via hotkey - [x] stop time when paused - [x] documentation - [x] notifications - [x] find good default hotkey, and/or hotkey prefix (like GNU screen, tmux) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:15:45 +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#1050
No description provided.