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.
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.
STEP2
At the output terminal, type “tty” command.
$ tty /dev/ttys002
Now you get output terminal’s TTY device name(=/dev/ttys002).
STEP3
At the debugged terminal, launch trachet.
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
TFF - Terminal Filter Framework https://github.com/saitoha/tff
Reference
vt100.net http://vt100.net/
Private Control Functions used by DEC http://vt100.net/emu/ctrlfunc_dec.html
Xterm Control Sequences http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
TeraTerm / Supported Control Functions http://ttssh2.sourceforge.jp/manual/en/about/ctrlseq.html
MinTTY / Mintty-specific control sequences http://code.google.com/p/mintty/wiki/CtrlSeqs
RLogin / Supported control codes http://nanno.dip.jp/softlib/man/rlogin/ctrlcode.html
License
GNU GENERAL PUBLIC LICENSE Version 3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4abba69428e9ed793cb01b8d46a9019af4a0e5f81a63e593936bb3846d9dade |
|
MD5 | 5fe949a40075892e74f25ffedc4ca8c6 |
|
BLAKE2b-256 | 3d9ef5ccb1bb6a6203adb1b0b109b77d3cebb7267f1fff4c730ceb89ed089be4 |
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: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 272681ac9f13c26554549fbfc5246b90effbddfd8857954d51fb3be88bdf3f99 |
|
MD5 | 34ac9f3e6dd586a546ce4dde86273bca |
|
BLAKE2b-256 | 238bd2644828f7da96f338fdbe78ca0645c576f87a48116837f043d7aebf2e50 |
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: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18593ef3a25b555070ed30e31ace2f22f7c818b8f3eed0e51e454af6d77b9a64 |
|
MD5 | 1cfe9c7e1f5c3663cddef6896b675d04 |
|
BLAKE2b-256 | 64f67cae364b17f92408999fb65763910638dd10915347506117b3b8e6ea97e1 |