The answerback string is configurable in xterm using the
answerbackString resource. That resource was added in 1998. Initially returning "xterm", since 1999 it defaults to an empty string because some users noticed the potential for abuse of control sequences which might send an unexpected command to the computer.
Other terminals may return an empty string always (konsole, mlterm, vte). But rxvt (and rxvt-unicode) return an unexpected response: the device attributes response for VT102 (an escape sequence). PuTTY returns "PuTTY" (probably due to early influence by xterm).
In a quick check, Linux console displays an "a" (probably a bug).
Because the original VT100 provided this as a setup/configurable feature, that would have been limited to printable characters. For that reason, rxvt/urxvt's response is unexpected. The manual page makes an obscure comment about this:
Specify the reply rxvt-unicode sends to the shell when an ENQ
(control-E) character is passed through. It may contain escape
values as described in the entry on
(the promised description is absent).
Because the length of the answerback string is unknown, an application that reads it must allow for waiting (in case the characters arrive in more than one read operation). There is of course the ksh/bash-specific
TMOUT feature which can help with shell-scripting, along with the
-t option for the
read command. For general use, I avoid that, using
stty, e.g., (see
stty raw -echo min 0 time 5
to temporarily set the terminal so that a
read will timeout in 0.5 seconds, and allow it to return without reading any characters. To see how the settings are saved/restored, it helps to read the script.