Package: trachet
What is This?trachet = tracer + ratchet(step-by-step debugging service)This Program runs as a terminal filter process, between Terminals and Applications.
It provides step-by-step debugging and formatted sequence tracing service.
You can look terminal I/O sequence on realtime, and it enables you to do step-by-step execution.http://saitoha.github.io/trachet/Installvia github$ git clone --recursive https://github.com/saitoha/trachet.git
$ cd trachet
$ python setup.py installor via pip$ pip install trachetUsage$ trachet [options] commandOptions:-h, --help                  show this help message and exit
-o OUTPUT, --output=OUTPUT  specify output device or file
-b, --break                 "break" the program at the startup time
-m, --monochrome            don't use color in output terminal"
--version                   show versionSequense TracingIf you specified TTY device by -o option,
you can look I/O sequence tracing on realtime.Step by Step debugging<F6>
Toggle trace state ON/OFF.<F7>
Toggle break state ON/OFF.<F8>
Step to next char or control sequence.<F9>
Step to next ESC or CSI sequence.QuickStartSTEP1First, You need to prepare two terminal windows,
debugged terminal and output terminal.STEP2At the output terminal, type “tty” command.$ tty
/dev/ttys002Now you get output terminal’s TTY device name(=/dev/ttys002).STEP3At the debugged terminal, launch trachet.Run default shell and send formatted I/O sequences to output terminal$ trachet -o/dev/ttys002Run default shell and write non-colored formatted I/O sequences to a text file.$ trachet -o log.txtRun vim and send formatted I/O sequences to output terminal.$ trachet -o/dev/ttys002 vimRun emacs and send formatted I/O sequences to output terminal,
and “break” emacs on startup time$ trachet -b -o/dev/ttys002 emacs -nwReplay output log created by script(1) step by step.$ trachet -b -o/dev/ttys002 cat ~/typescript -How It WorksPTY and Normal Terminal/Application:+---------------------------------------------+
|                  Terminal                   |
+---------+-----------------------------------+
          |
+---------|-----------------------------------+
|  +------+-------+        +---------------+  |
|  |    Master    |========|     Slave     |  |
|  +--------------+        +-------+-------+  |
+----------------------------------|----------+
                                   |
+----------------------------------+----------+
|                Application                  |
+---------------------------------------------+TFF (Terminal Filter Framework):Scanner                    Event Driven Parser         Event Dispatcher
                    +-----+                         +-----+                     +-----+
  << I/O Stream >>  |     | << CodePoint Stream >>  |     | << Event Stream >>  |     |      << I/O Stream >>
------------------->|     |------------------------>|     |-------------------->|     |---||-------------------->
  (Raw Sequences)   |     |    (Unicode Points)     |     |   (Function Call)   |     |       (Raw Sequences)
                    +-----+                         +-----+                     +--+--+
                                               ISO-2022 ISO-6429                   |
                                               Compatible Parsing                  |
                                                                                   v
                                                                                +-----+
                                                                 Event Observer |     |      << I/O Stream >>
                                                                  (I/O Handler) |     |---||-------------------->
                                                                                |     |       (Raw Sequences)
                                                                                +-----+With Trachet…+----------------------------------------------------------+   +------------------------+
|                                                          |   |                        |
|                        Terminal                          |   |  Other Device or File  |
|                                                          |   |                        |
+----------------------------------------------------------+   +------------------------+
                     |                       ^                              ^
                     |                       |                              |
                 < input >               < output >                         |
                     |                       |                              |
                     |      +----------------+                              |
                     |      |                      [ PTY 1 ]                |
              +------|------|-------------------------------+               |
              |      v      |                               |               |
              |  +----------+---+       +----------------+  |               |
              |  |    Master    |=======|      Slave     |  |               |
              |  +--------------+       +--+-------------+  |               |
              |                            |        ^       |               |
              +----------------------------|--------|-------+               |
                                           |        |                       |
                                       < input >    |                       |
                                           |        |                   < trace >
                           +---------------+    < output >                  |
                           |                        |                       |
   [ Trachet Process ]     |                        |                       |
+--------------------------|------------------------|---------------+       |
|                          |                        |               |       |
|              +-----------|-------<< TFF >>--------|------------+  |       |
|              |           v                        |            |  |       |
|  < control > |  +-----------------+     +---------+---------+  |  |       |
|       +----->|  |  InputHandler   |     |   OutputHandler   |  |  |       |
|       |      |  +--+-----+----+---+     +--+----------------+  |  |       |
|       |      |     |     |    |            |      ^            |  |       |
|       |      +-----|-----|----|------------|------|------------+  |       |
|       |            |     |    |            |      |               |       |
|       |            |     |    |            |      |               |       |
|       |            v     |    v            v      |               |       |
|  +----+---------------+  |  +----------------+    |               |       |
|  |  ActionController  |  |  |     Tracer     |----------------------------+
|  +--------------------+  |  +----------------+    |               |
|                          |                        |               |
+--------------------------|------------------------|---------------+
                           |                        |
                       < input >                < output >
                           |                        |
                           |       +----------------+
                           |       |
                           |       | [ PTY 2 ]
                   +-------|-------|-----------------------------+
                   |       v       |                             |
                   |  +------------+--+       +---------------+  |
                   |  |    Master     |=======|     Slave     |  |
                   |  +---------------+       +----+----------+  |
                   |                               |      ^      |
                   +-------------------------------|------|------+
                                                   |      |
                              +--------------------+      |
                              |                           |
                          < input >                   < output >
                              |                           |
                              v                           |
+---------------------------------------------------------+-----------------------------+
|                                                                                       |
|                                  Target Application                                   |
|                                                                                       |
+---------------------------------------------------------------------------------------+DependencyTFF - Terminal Filter Frameworkhttps://github.com/saitoha/tffReferencevt100.nethttp://vt100.net/Private Control Functions used by DEChttp://vt100.net/emu/ctrlfunc_dec.htmlXterm Control Sequenceshttp://invisible-island.net/xterm/ctlseqs/ctlseqs.htmlTeraTerm / Supported Control Functionshttp://ttssh2.sourceforge.jp/manual/en/about/ctrlseq.htmlMinTTY / Mintty-specific control sequenceshttp://code.google.com/p/mintty/wiki/CtrlSeqsRLogin / Supported control codeshttp://nanno.dip.jp/softlib/man/rlogin/ctrlcode.htmlLicenseGNU GENERAL PUBLIC LICENSE Version 3