2021-10-23 01:25:44 +00:00
|
|
|
set send_human {0.05 0.1 1 0.05 1}
|
2021-10-22 16:24:02 +00:00
|
|
|
set timeout 2
|
|
|
|
|
2021-10-23 16:34:58 +00:00
|
|
|
proc pause {duration} {
|
|
|
|
sleep $duration
|
|
|
|
}
|
|
|
|
|
2021-10-22 16:24:02 +00:00
|
|
|
proc expect_prompt {} {
|
|
|
|
expect "$ "
|
|
|
|
}
|
|
|
|
|
|
|
|
proc run_command {cmd} {
|
|
|
|
send -h "$cmd"
|
|
|
|
send "\r"
|
2021-10-22 21:17:37 +00:00
|
|
|
expect -timeout 5 "$ "
|
2021-10-22 16:24:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|