2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ttyrec | 端末操作を保存、再生するツール ttyrec を Cygwin 環境にインストール

Posted at

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

参照

http://0xcc.net/ttyrec/
https://github.com/mjording/ttyrec

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?