termdebug - utilities for debugging interactive terminal programs.
Contents
Copyright
Copyright © 2010,2012 G.P. Halkes
termdebug is licensed under the GNU General Public License version 3.
For more details on the license, see the file COPYING in the documentation directory. On Un*x systems
this is usually /usr/share/doc/termdebug.
Description
termdebug is a set of utilities to record and replay the input and output of terminal programs. Its main
goal is to aid in developing and debugging terminal programs. Other programs such as termrec/termplay,
nethack-recorder/player and script/scriptreplay only record the output. However, when debugging an
interactive terminal program, the input is often as important as the output.
termdebug consists of the following utilities:
tdrecord
Starts a program and records its input and output.
tdreplay
Starts a program and replays the input of a recording.
tdview Shows the output of a recording.
tdrerecord
Starts a program and replays the input of a recording, recording the input and output to create a
new recording.
tdcompare
Compares two recordings to determine if there are differences. The reported differences can be
either on the exact input/output behaviour, or on the visual behaviour.
Grammar
The recordings made with the termdebug utilities use a simple format. Each recording consists of a set of
directives with arguments. White space is not important. The language supports line comments which start
at # and run to the end of the line. The only other elements are numbers (a sequence of digits) and
strings. Strings start and end with a double qoute, and use C-style escaping. The following directives
are known:
envnamevalue
Set the value of environment variable name to value. name and value are strings. All env
directives must appear before the start directive.
window_sizecolumnslines [delay [>min_delay]]
Set the terminal window size to columns by lines_. May be specified both before and after the
start directive. On optional delay in milliseconds may be specified. Furthermore, min_delay may be
specified to force a wait of at least min_delay milliseconds regardless of program options
changing the key delay.
startclient [argument+]
The start directive indicates the client to start. Zero or more arguments for the client may be
specified. client and argument are strings.
require_versionversion
Tell the interpreter that the script langauge version must be version. The current version is 1.
The following directives may only appear after the start directive:
expectstring+
Indicate what output to expect. One or more strings may be specified.
send (delaystring [>min_delay)+
Specify one or more key strings to send to the client program. delay is the delay in miliseconds
to wait before sending string. Furthermore, min_delay may be specified to force a wait of at least
min_delay milliseconds regardless of program options changing the key delay.
expect_exitstatus
Signal that the client should stop at this point, returning status.
expect_suspend
Indicate that the client should suspend itself at this point.
interact
Indicate the interaction with the user should be started at this point. Any directives after this
point will be ignored.
Name
termdebug - utilities for debugging interactive terminal programs.
See Also
tdrecord(1), tdreplay(1), tdrerecord(1), tdview(1) 2.2 2013/03/03 TERMDEBUG(1)
