Skip to main content

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/

https://raw.githubusercontent.com/saitoha/trachet/data/data/trachet1.png

Install

via github

$ git clone --recursive https://github.com/saitoha/trachet.git
$ cd trachet
$ python setup.py install

or via pip

$ pip install trachet

Usage

$ trachet [options] command
  • Options:

    -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 version
  • Sequense Tracing

    If 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.

QuickStart

  • STEP1

    First, You need to prepare two terminal windows, debugged terminal and output terminal.

    https://raw.githubusercontent.com/saitoha/trachet/data/data/trachet_qs1.png
  • STEP2

    At the output terminal, type “tty” command.

    $ tty
    /dev/ttys002

    Now you get output terminal’s TTY device name(=/dev/ttys002).

    https://raw.githubusercontent.com/saitoha/trachet/data/data/trachet_qs2.png
  • STEP3

    At the debugged terminal, launch trachet.

    https://raw.githubusercontent.com/saitoha/trachet/data/data/trachet_qs3.png

    Run default shell and send formatted I/O sequences to output terminal

    $ trachet -o/dev/ttys002

    Run default shell and write non-colored formatted I/O sequences to a text file.

    $ trachet -o log.txt

    Run vim and send formatted I/O sequences to output terminal.

    $ trachet -o/dev/ttys002 vim

    Run emacs and send formatted I/O sequences to output terminal, and “break” emacs on startup time

    $ trachet -b -o/dev/ttys002 emacs -nw

    Replay output log created by script(1) step by step.

    $ trachet -b -o/dev/ttys002 cat ~/typescript -

How It Works

  • PTY 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                                   |
    |                                                                                       |
    +---------------------------------------------------------------------------------------+

Dependency

Reference

License

GNU GENERAL PUBLIC LICENSE Version 3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trachet-1.0.9.tar.gz (69.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

trachet-1.0.9-py2.7.egg (144.4 kB view details)

Uploaded Egg

trachet-1.0.9-py2.6.egg (144.4 kB view details)

Uploaded Egg

File details

Details for the file trachet-1.0.9.tar.gz.

File metadata

  • Download URL: trachet-1.0.9.tar.gz
  • Upload date:
  • Size: 69.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trachet-1.0.9.tar.gz
Algorithm Hash digest
SHA256 a4abba69428e9ed793cb01b8d46a9019af4a0e5f81a63e593936bb3846d9dade
MD5 5fe949a40075892e74f25ffedc4ca8c6
BLAKE2b-256 3d9ef5ccb1bb6a6203adb1b0b109b77d3cebb7267f1fff4c730ceb89ed089be4

See more details on using hashes here.

File details

Details for the file trachet-1.0.9-py2.7.egg.

File metadata

  • Download URL: trachet-1.0.9-py2.7.egg
  • Upload date:
  • Size: 144.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trachet-1.0.9-py2.7.egg
Algorithm Hash digest
SHA256 272681ac9f13c26554549fbfc5246b90effbddfd8857954d51fb3be88bdf3f99
MD5 34ac9f3e6dd586a546ce4dde86273bca
BLAKE2b-256 238bd2644828f7da96f338fdbe78ca0645c576f87a48116837f043d7aebf2e50

See more details on using hashes here.

File details

Details for the file trachet-1.0.9-py2.6.egg.

File metadata

  • Download URL: trachet-1.0.9-py2.6.egg
  • Upload date:
  • Size: 144.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trachet-1.0.9-py2.6.egg
Algorithm Hash digest
SHA256 18593ef3a25b555070ed30e31ace2f22f7c818b8f3eed0e51e454af6d77b9a64
MD5 1cfe9c7e1f5c3663cddef6896b675d04
BLAKE2b-256 64f67cae364b17f92408999fb65763910638dd10915347506117b3b8e6ea97e1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.9 This release

3 files

1.0.8

3 files

1.0.7

4 files

1.0.6

4 files

1.0.5

4 files

1.0.4

4 files

1.0.3

4 files

1.0.2

4 files

1.0.1

4 files

1.0.0

4 files

0.3.21

4 files

0.3.20

4 files

0.3.19

4 files

0.3.18

4 files

0.3.17

4 files

0.3.16

4 files

0.3.15

4 files

0.3.14

4 files

0.3.13

4 files

0.3.12

4 files

0.3.11

4 files

0.3.10

4 files

0.3.9

4 files

0.3.8

4 files

0.3.7

4 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

3 files

0.2.5

3 files

0.2.4

3 files

0.2.3

3 files

0.2.2

3 files

0.2.1

3 files

0.2.0

3 files

0.1.18

3 files

0.1.17

3 files

0.1.16

3 files

0.1.15

3 files

0.1.14

3 files

0.1.12

3 files

0.1.11

3 files

0.1.10

3 files

0.1.8

3 files

0.1.7

3 files

0.1.5

3 files

0.1.4

3 files

0.1.3

3 files

0.1.2

3 files

0.1.1

3 files

0.1.0

3 files

0.0.14

3 files

0.0.13

3 files

0.0.12

3 files

0.0.11

3 files

0.0.10

3 files

0.0.9

3 files

0.0.8

3 files

0.0.7

3 files

0.0.6

3 files

0.0.5

3 files

0.0.4

3 files

0.0.3

3 files

0.0.2

3 files

0.0.1

3 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page