Next: , Previous: Color Mode, Up: Top   [Contents][Index]

5 The Reseq Command


reseq [-t|--timings=timings] input output
reseq --replay [-d divisor] input [output]
reseq -h | --help
reseq -V | --version

The input and output arguments are mandatory, but may be specified as ‘-’ for standard input or output. Reseq doesn’t let output default to standard output because, since it generates raw terminal codes, it is uncommon (and potentially unsafe) to send this directly to the terminal. The exception is when the --replay argument has been specified, which is only useful when output is going to the terminal; in that event, the output argument is optional.


Print usage information on standard output and exit successfully.


Print the version number and licensing information of hello on standard output and then exit successfully.


Honor delay lines in the input, pausing the specified amount of time before continuing to process the next line. This is useful for producing behavior equivalent to that of the scriptreplay command (from util-linux), but using a Teseq output file as input, rather than a raw typescript file.


Only takes effect if ‘--replay’ is also specified. In addition to honoring delay lines, also honors user-inserted “halt” lines (those beginning with ‘@@@’) in the input. These lines cause reseq to halt processing until the user presses a key.

This halting action is not accompanied by any sort of indication that reseq is awaiting user action; it is up to the user to ensure that the input script to reseq has included some sort of appropriate indication.

When ‘--halts’ is in effect, reseq will turn off terminal echoing (so the user’s keypress to continue the script is not shown), and switches the terminal over to unbuffered I/O, so that keypresses can be read as soon as they are typed.

-t timings
--timings timings

Produce timing information from delay lines, in the format generated by script -t. This can be used to regenerate script typescript and timing files that were fed as the input to teseq -t timings. Note that the result will differ slightly from the output from script -t, in that the first delay will be zeroed out (teseq always throws out the first delay value, whose value from script is an arbitrary value between 0 and 1), and the last delay line will include all the remaining characters (script’s timings don’t count the final timestamp line).

The reseq command essentially does the reverse of teseq. If you feed it the output from teseq, it will generate the corresponding escape sequences—that is, it will generate the same content that was fed to teseq to produce that output. The shell command

$ teseq foo | reseq - -

is roughly equivalent to

$ cat foo

The reseq command is written in Perl, unlike teseq which is compiled from C-language sources, and so requires a Perl interpreter to be present in order to function.

Of the various types of lines output by the teseq command, reseq only understands four; text lines:

|Hello, there|.
|Here are|-
-|some wrapped|-

control-character lines:

. CR/^M LF/^J

escape-sequence lines:

: Esc [ 31 ; 3 m

And, of course, delay lines:

@ 3.14159

Next: , Previous: Color Mode, Up: Top   [Contents][Index]