Next: Output Format, Previous: Overview, Up: Top
The format for running the teseq program is:
teseq options [input-file] [output-file]
teseq -h | --help
teseq -V | --version
If input-file or output-file is unspecified, or specified as ‘-’, standard input/output is used. Output is written to standard output by default, but see the -o option.
. CR LF
rather than
. CR/^M LF/^J
Still, this option can be useful (in combination with -L) for
those that don't care about the exact sequence of characters, or what
their function is called, but just what their effects in the terminal
are (those that Teseq understands). The output produced
Note that there are no options for suppressing text lines (‘|’) or control-character lines (‘.’), as there are for description or escape-sequence lines.
The -L, -D and -E options also have mnemonic equivalents of -&, -" and -: respectively, corresponding to the character prefixes for the lines they suppress; and -C has an -^ equivalent, for the ‘^X’-style control representations it suppresses. However, while they may be more practical to remember, they will be less practical to type, since both -& and -" are apt to be interpreted as special by the shell, and must be quoted in order to pass them to the teseq command.
When teseq is started with a terminal as its input, it sets the terminal to non-canonical mode. That way, you can see real-time translation of input, as you type. If both input and output are terminals, then teseq will also turn local echo off, so that the characters you type will not interfere with the output you see. You can try it out by simply running teseq without any arguments. Note, this means that the control for indicating “end-of-file” (usually ‘C-d’) will not be processed specially, but will be passed through to teseq like any other character. Use the interrupt character (usually ‘C-c’) instead, or specify --no-interactive to disable this behavior.
When run in this way, characters typed as input are immediately translated and written out. The exception is that when an escape character is encountered, teseq must wait for the next few characters before writing anything, so it can decide whether to start an escape line or a control-character line.
When teseq has a terminal as its output, it is careful to ensure that it finishes output lines when it is stopped by a signal. If it was in the middle of writing a text line, it will write the closing pipe character ‘|’, followed by a newline. If it was in the middle of trying to determine whether it's in a valid escape sequence or just an escape character followed by other characters, it will assume the latter case, and translate all the characters it has seen so far.
To force teseq to behave as if it's not connected to a terminal (that is, to refrain from ensuring lines are finished, or setting non-canonical/no-echo mode), use the --no-interactive (-I) option.
The teseq program does not take care to finish lines when the output is not a terminal.
Whether or not teseq is connected to a terminal, it uses unbuffered I/O by default, unless the input is an ordinary file. This is so that each character may be processed as soon as it's seen. However, this can result in much longer processing time overall. To force teseq to buffer its input and output, use the --buffered (-b) option.