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

Metadata

Release files for trachet 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trachet 1.0.9
File Size Uploaded
trachet-1.0.9.tar.gz 69.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for trachet 1.0.9
File Interpreter ABI Platform
trachet-1.0.9-py2.7.egg Legacy Egg format - - Details
trachet-1.0.9-py2.6.egg Legacy Egg format - - Details

Total release size: 357.8 kB

Release files / trachet-1.0.9.tar.gz

Download URL trachet-1.0.9.tar.gz
Size 69.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a4abba69428e9ed793cb01b8d46a9019af4a0e5f81a63e593936bb3846d9dade
BLAKE2b-256 checksum
How to use checksums
3d9ef5ccb1bb6a6203adb1b0b109b77d3cebb7267f1fff4c730ceb89ed089be4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / trachet-1.0.9-py2.7.egg

Download URL trachet-1.0.9-py2.7.egg
Size 144.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
272681ac9f13c26554549fbfc5246b90effbddfd8857954d51fb3be88bdf3f99
BLAKE2b-256 checksum
How to use checksums
238bd2644828f7da96f338fdbe78ca0645c576f87a48116837f043d7aebf2e50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / trachet-1.0.9-py2.6.egg

Download URL trachet-1.0.9-py2.6.egg
Size 144.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
18593ef3a25b555070ed30e31ace2f22f7c818b8f3eed0e51e454af6d77b9a64
BLAKE2b-256 checksum
How to use checksums
64f67cae364b17f92408999fb65763910638dd10915347506117b3b8e6ea97e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.9 This release

3 release files

1.0.8

3 release files

1.0.7

4 release files

1.0.6

4 release files

1.0.5

4 release files

1.0.4

4 release files

1.0.3

4 release files

1.0.2

4 release files

1.0.1

4 release files

1.0.0

4 release files

0.3.21

4 release files

0.3.20

4 release files

0.3.19

4 release files

0.3.17

4 release files

0.3.16

4 release files

0.3.15

4 release files

0.3.14

4 release files

0.3.13

4 release files

0.3.12

4 release files

0.3.11

4 release files

0.3.10

4 release files

0.3.9

4 release files

0.3.8

4 release files

0.3.7

4 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

3 release files

0.2.5

3 release files

0.2.4

3 release files

0.2.3

3 release files

0.2.2

3 release files

0.2.1

3 release files

0.2.0

3 release files

0.1.14

3 release files

0.1.12

3 release files

0.1.11

3 release files

0.1.10

3 release files

0.1.8

3 release files

0.1.7

3 release files

0.1.5

3 release files

0.1.4

3 release files

0.1.3

3 release files

0.1.2

3 release files

0.1.1

3 release files

0.1.0

3 release files

0.0.13

3 release files

0.0.12

3 release files

0.0.11

3 release files

0.0.10

3 release files

0.0.9

3 release files

0.0.8

3 release files

0.0.7

3 release files

0.0.6

3 release files

0.0.5

3 release files

0.0.4

3 release files

0.0.3

3 release files

0.0.2

3 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page