mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 07:55:51 +03:00
[PR #340] [MERGED] Pause/resume recording #436
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#436
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
develop← Head:feature/muting📝 Commits (10+)
8aecc1dLet pty recorder report elapsed time13bb071Passappendinstead of mode to all writer types8e29f97Don't overwrite buffering mode in async writer level2d27db2Refactor v2 writerb9ece31Move recording details to newrecordermodule7af03d8Handle time offset in pty.record instead of in writer9cfc1d2Mute recording with ctrl+p9e9df3aDocument muting41fecedpycodestyle0ba174b"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 (likectrl+a <key>inscreen,ctrl+b <key>intmux).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_commandwhich 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 (viatmux display-message) or show a desktop notification (notify-send, Growl, etc) or play a sound.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.