Takuo KITAME wrote: > Description: A tty recorder > ttyrec is a tty recorder. A recorded data can be playback with the included > ttyplay command. ttyrec is just a derivative of script command for recording > timing information with microsecond accuracy as well.
Hmm, are you aware of bug #68556? I implemented the same thing as a trivial patch to script, it has not been applied yet, probably because bsdutils was not maintained and just got a new maintainer recently. Getting my patch in (upstream too) seems like a much more elegant option than introducing a whole new package. My method also has the (IMHO) benefit of separating the timings and output, so the output remains usable on its own just like any typescript, while the timings are in a nice easy to parse and edit plain text format, unlike the combined binary format that ttyrecord outputs. BTW, ttyplay is buggy -- I recorded a session that consisted of me running a "find /" and interupting it part way through total record time: 0:06.84. Total playback time: 1:28.60. Another good example of the problem is to run ttyrec, and paste the following command into it: perl -e '$|=1; for (1..20) { for (1..80) { print "." }; print "\n"; }' Each dot is printed individually, but it will happen so fast you'll barely notice it (aside from some cursor churn). Then play back the script... and watch it print out every dot one at a time. My little playback program performs better (even though it is written in perl), because it takes the latency of a system call into consideration: # Sleep, unless the delay is really tiny. Realy tiny delays cannot # be accurately done, because the system calls in this loop will # have more overhead. The 0.0001 is arbitrary, but works fairly well. if ($delay / $divisor > 0.0001) { select(undef, undef, undef, $delay / $divisor - 0.0001); And so its rendition of the find test and the dot-at-a-time test is much better. This isn't just a theoretical excersize -- I have used the modified script to record debian upgrade sessions, and some things (I think dpkg) do actually output messages one character at a time. -- see shy jo