View on GitHub


Terminal I/O step-by-step debugger

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 watch terminal I/O sequence on realtime, and it enables you to do step-by-step execution.

Most of terminal applications such as vi have single threaded UI and typically has blocking terminal I/O. So trachet might be useful for both of terminal emulator developers and terminal application developers.



via pip

    $ pip install trachet

via github

    $ git clone --recursive
    $ cd trachet
    $ python install


    $ trachet [options] command


    -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
    --version                   show version

Sequense Tracing

If you specified TTY device by -o option, you can look I/O sequence tracing on realtime (See Quick Start).

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.

This settings can be changed with editing $HOME/.trachet/

Quick Start

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

STEP2 At the output terminal, type "tty" command.

$ tty 

Now you get output terminal's TTY device name(=/dev/pts/4).

STEP3 At the debugged terminal, launch trachet.

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

$ trachet -o/dev/pts/4

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/pts/4 vim 

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

$ trachet -b -o/dev/pts/4 emacs -nw

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

$ trachet -b -o/dev/pts/4 cat ~/typescript -