ttyrec | 端末操作を保存、再生するツール ttyrec を Cygwin 環境にインストール
概要
端末操作を保存、再生するツール ttyrec を Cygwin 環境にインストールします。
※インストールの目的は, cygwin 環境で percol のスクリーンキャプチャをとるためです。
手順
- ttyrec の tar を取得、解凍してパッチをあてます
$ cd ~/
$ mkdir ttyrec
$ cd ttyrec
$ mkdir src
$ mkdir compile
$ cd src
$ wget http://0xcc.net/ttyrec/ttyrec-1.0.8.tar.gz
$ wget http://mitsuki.engawa.org/image/ttyrec-1.0.8-cygwin-patch
$ cd ../compile
$ tar zxvf ../src/ttyrec-1.0.8.tar.gz
$ cd ttyrec-1.0.8/
$ patch < ../../src/ttyrec-1.0.8-cygwin-patch
- bashを利用したいので、 ttyrec.c を編集して shell ではなく bash を利用するようにします。
ttyrec.c
@@ -159,7 +159,7 @@ main(argc, argv)
shell = getenv("SHELL");
if (shell == NULL)
- shell = "/bin/sh";
+ shell = "/user/bin/bash";
getmaster();
fixtty();
- makeします。
$ make
$ cp ttyrec.exe /usr/local/bin/
$ cp ttyplay.exe /usr/local/bin/
$ cp ttytime.exe /usr/local/bin/
確認
# 操作保存: ファイル名を指定しないと、./ttyrecord に保存される
$ ttyrec
# 操作例
$ echo hoge
hoge
$ cal
8月 2014
日 月 火 水 木 金 土
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
# Ctrl + D で操作の保存終了
# 操作再生
$ ttyplay ttyrecord
# 保存した操作が再生されます
$ echo hoge
hoge
$ cal
8月 2014
日 月 火 水 木 金 土
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
# 操作再生(2倍速)
$ ttyplay -s 2.0 ttyrecord
# 保存した操作が2倍速で再生されます
$ echo hoge
hoge
$ cal
8月 2014
日 月 火 水 木 金 土
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31