Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
Chapter 6 121
Typeahead Mode
Working in Typeahead Mode
How Typeahead Mode Works
When data is entered from a terminal with typeahead mode active, the
data is staged in a special typeahead buffer before being sent through
to the process requesting the data. Any read posted against a terminal
with typeahead mode active will first access the typeahead buffer,
rather than accepting data directly from the device.
The typeahead buffer is limited to 224 bytes; anything in excess of this
limit will cause an XOFF to be sent. You should be sure that
XON/XOFF transmission pacing is enabled for the terminal if
typeahead mode is used. You should avoid using typeahead mode if you
anticipate that reads will exceed 224 bytes, to avoid overflowing the
typeahead buffer.
If typeahead is on but the terminal user has not typed ahead, the
system will act in essentially the same way that it would if typeahead
were not enabled. A DC1 read trigger will be sent to the terminal any
time the system is ready to receive data, and there is no data in the
typeahead buffer. If, however, the user has typed ahead, and there is
data in the buffer, the system will simply accept the typed ahead data
and will not send a DC1 read trigger to the terminal.
Typeahead Mode and Echo
When typeahead is in use the terminal user will, in most cases, see
input echoed to the terminal twice. The first echo is a “convenience
echo”, which appears when the data is being typed. This echo allows the
user to see the characters that are typed, and to make corrections, if
necessary, before entering the end-of-record character.
The second echo appears at the time the data in the typeahead buffer is
actually accepted by the system. This echo lets the user know that the
read is being processed.
A second type of typeahead mode exists—single echo typeahead mode.
With this mode, the device driver withholds the echoing of typeahead
data until a read is posted for the data.
There are, however, certain cases in which the first echo will not be seen
at the terminal. For example, if the terminal user types ahead while the
system is displaying data, such as the output to a :LISTF command,
the convenience echo will not appear.
Also, a user whose terminal is in typeahead mode but who is not typing
ahead will see the input echoed only once.