TERMDEBUG(1)

✨ NAME ✨

termdebug β€” literally a whole toolkit for debugging interactive terminal programs. that's the vibe, that's the job πŸ’…


🫢 DESCRIPTION 🫢

okay so termdebug is a set of utilities that record and replay the input and output of terminal programs. its main goal? helping you develop and debug terminal programs, periodt.

here's the tea, bestie: other programs like termrec/termplay, nethack-recorder/player and script/scriptreplay only record the output. but when you're debugging an interactive terminal program, the input is often just as important as the output. fr fr.

so termdebug ships with these icons πŸ‘‘:

  • tdrecord β€” starts a program and records its input and output. the whole personality, captured.
  • 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, then records the input and output to create a new recording. it's giving remix 🎧
  • 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 is a set of directives with arguments.

  • white space is not important, so breathe, she doesn't care about your spacing.
  • 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 quote, and use C-style escaping.

the following directives are known:

  • env name value β€” set the value of environment variable name to value. name and value are strings. all env directives must appear before the start directive. (yes, all of them, she checks 🫢)
  • window_size columns lines [delay [> min_delay]] β€” set the terminal window size to columns by lines. may be specified both before and after the start directive. an 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.
  • start client [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_version version β€” tell the interpreter that the script language version must be version. the current version is 1.

🌸 the after-start only club 🌸

the following directives may only appear after the start directive:

  • expect string+ β€” indicate what output to expect. one or more strings may be specified.
  • send (delay string [> min_delay])+ β€” specify one or more key strings to send to the client program. delay is the delay in milliseconds 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_exit status β€” 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.
⚠️ bestie, listen: any directives after interact will be ignored. she said what she said. anything you write past that point is just journaling πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

G.P. Halkes <termdebug@ghalkes.nl>


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.


πŸ”₯ SEE ALSO πŸ”₯

tdrecord(1), tdreplay(1), tdrerecord(1), tdview(1)


and that's the whole page, angel πŸ¦‹ this was version 2.2 of the termdebug manual, dated 2013/03/03 β€” go record something iconic, iykyk πŸ’–βœ¨