mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 06:27:43 +00:00
78050b3d42
It can take quite a while to record a demo. This patch adds a `--fast` flag for reducing delays to a tenth of the usual. You can play the recording with `asciinema play -s 0.1` to get close-to-normal speed (except that command delays will be slower). That way you can adjust timings with shorter round-trips.
30 lines
513 B
Tcl
30 lines
513 B
Tcl
set send_human {0.05 0.1 1 0.05 1}
|
|
set timeout 2
|
|
|
|
proc pause {duration} {
|
|
sleep $duration
|
|
}
|
|
|
|
proc expect_prompt {} {
|
|
expect "$ "
|
|
}
|
|
|
|
proc run_command {cmd} {
|
|
send -h "$cmd"
|
|
send "\r"
|
|
expect -timeout 5 "$ "
|
|
}
|
|
|
|
proc quit_and_dump_asciicast_path {} {
|
|
set CTRLC \003
|
|
set CTRLD \004
|
|
set ESC \033
|
|
|
|
send $CTRLD
|
|
expect "asciinema: recording finished"
|
|
sleep 1
|
|
send $CTRLC
|
|
expect -re "asciicast saved to (.+)$ESC.*\r" {
|
|
send_user "$expect_out(1,string)\n"
|
|
}
|
|
}
|