Skip to main content

Step-by-step/realtime terminal debugger. It tell you what is happening on your terminal.

Project description

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/

http://zuse.jp/misc/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.

    http://zuse.jp/misc/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).

    http://zuse.jp/misc/trachet_qs2.png
  • STEP3

    At the debugged terminal, launch trachet.

    http://zuse.jp/misc/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

Project details


Download files

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

Source Distribution

trachet-0.3.17.tar.gz (66.2 kB view details)

Uploaded Source

Built Distributions

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

trachet-0.3.17-py2.7.egg (137.1 kB view details)

Uploaded Egg

trachet-0.3.17-py2.6.egg (137.1 kB view details)

Uploaded Egg

trachet-0.3.17-py2.5.egg (136.4 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for trachet-0.3.17.tar.gz
Algorithm Hash digest
SHA256 fc86498e1d4744d7defd840eb3828364f5f5e3051bc152c36de227421c0dc70d
MD5 479ba6b55ea1a4577079d9f8fbd2ef7a
BLAKE2b-256 8ce0cfdd14ee461373c0ad0a96854485acd0f6e178ace7d85e926e1de7f725b8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for trachet-0.3.17-py2.7.egg
Algorithm Hash digest
SHA256 1f2cc2827a7cc5928f27855955cd3c5362cdc6bea94081e070a1765c0aa066d2
MD5 5e7963a584674fb2f7c3644b4fe5f7e9
BLAKE2b-256 95d23ce84176c0738c1c480a332c5cd1a6e3b902343313dcd6ef63ac7e9f44b9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for trachet-0.3.17-py2.6.egg
Algorithm Hash digest
SHA256 c3f8d34253ee58df294cece646556bce35f59301d8d99af721dd9990570c62fe
MD5 001abde2ba3923b14c511c9c30a3ee65
BLAKE2b-256 fcc37f9f85ffe4f8b04a459a3a929825a6367772c38a1cfe40e8edb3fc7edcf4

See more details on using hashes here.

File details

Details for the file trachet-0.3.17-py2.5.egg.

File metadata

  • Download URL: trachet-0.3.17-py2.5.egg
  • Upload date:
  • Size: 136.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trachet-0.3.17-py2.5.egg
Algorithm Hash digest
SHA256 737a9220ae4663e22f66707475610705ce6fc202296b53020aa7e9fef49480ae
MD5 303d88b1b6ff214793856fa24999711c
BLAKE2b-256 c733fcaef422f9cf81094dcf87c9b3eb2ba2b5d8cb4516b4b02aae417b2aad3a

See more details on using hashes here.

Supported by

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