mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 16:05:52 +03:00
[GH-ISSUE #142] Support for split files #110
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#110
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?
Originally created by @mattboehm on GitHub (Feb 2, 2016).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/142
I'd like to leave a terminal running for days at a time and record all activity to files. In order to do so, I'd like a terminal recorder to output files at regular time intervals (every hour or so) so that it doesn't have to hold everything in memory and I don't have to wait until the process is over to examine the recording.
@ku1ik commented on GitHub (Feb 13, 2016):
Have you tried
scriptorttyrec? AFAIK they write the recorded stream directly to the target file during the recording.@mattboehm commented on GitHub (Feb 15, 2016):
Thanks I'll try playing with them. The big missing feature for me is the ability to split files-- leave a terminal active for days, but have named files for every hour so that I can quickly delete the oldest or quickly jump to a specific time.
I can't simply split a ttyrec recording at an arbitrary point in time: at the start of the second file, it would not know the initial value for all the coordinates on the screen. I could perhaps trigger or simulate a redraw at the desired split point, but I figured the feature might be complicated enough that it'd be better off implemented in Go.
Granted, it's probably not a widely desirable feature, so I'd understand if you thought it felt too outside the general use case to warrant inclusion. If it seems reasonable to you, I'm willing to take a stab at implementing it, but wanted to raise the issue with you first to get a sense of its feasibility/practicality, as I'm still fairly unfamiliar with both go and the inner workings of terminals.
@ku1ik commented on GitHub (Feb 16, 2016):
Not sure if you realize this but if you would split asciinema recording you also couldn't play the later part without having the previous ones. The same problem as you described with ttyrec.
@mattboehm commented on GitHub (Feb 17, 2016):
Yep, I realize that. My assumption is that if you "played" the recording from the beginning, keeping track of what characters/colors belong in each coordinate, then when you reach a point where you want to split, you could start part-2 with whatever codes were necessary for it to look like it should have at the end of part-1.
@ku1ik commented on GitHub (Feb 20, 2016):
That would work, yeah. However, there is one big obstacle here: it's not possible to reliably "gather" necessary escape sequences without proper terminal state machine. asciinema recorder doesn't include one - it simply dumps stdout bytes to the file. Here's an example parser state machine: http://vt100.net/emu/vt500_parser.png (it's the one used by the web player).
I don't plan to add parser to the recorder because it's not needed here. Like I mentioned the web player has its own, and when you
asciinema play ...in the terminal it's your terminal emulator (xterm, iTerm etc) handling this with its internal parser and state machine.@mattboehm commented on GitHub (Feb 20, 2016):
Ah, I understand. In that case, it certainly seems outside of the scope of this project. Maybe I'll revisit this idea down the line, but for now I think it's safe to close this.