ENQ
ENQ (Enquiry) is a C0 control character that requests the terminal to send an answerback string. It was originally used in communication protocols to identify the remote device.
Syntax
ENQ 0x05
ENQ = 0x05 ;
Response
When the terminal receives ENQ, it transmits its configured answerback string back to the host. On DEC VT terminals, this string was user-configurable through the terminal's setup menu.
Description
Per ECMA-48 §8.3.44, ENQ "is transmitted by a sender as a request for a response from a receiver."
On DEC VT100 and later terminals, receiving ENQ causes the terminal to send a pre-configured answerback message. This was used to identify terminal types in multi-terminal environments and for simple challenge-response protocols.
Modern behavior
Most modern terminal emulators respond to ENQ with an empty string or ignore it entirely, as the answerback mechanism poses a security risk: a malicious document could embed ENQ characters to trigger the terminal to "type" the answerback string into the shell, potentially executing commands.
Some terminals (e.g., XTerm) allow configuring the answerback string but default to an empty response. The DA1 (Device Attributes) sequence is the preferred modern mechanism for terminal identification.
Configuring a non-empty answerback string can be a security risk. Untrusted input displayed in the terminal could contain ENQ characters, causing the answerback string to be injected as keyboard input.
Specifications
| Specification | Section |
|---|---|
| ECMA-48 | §8.3.44 |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | No evidence of ENQ/answerback implementation found |
| Bobcat | ✓ | 0.9.0 | AnswerBackMessage configurable in profiles (Terminal.cpp:370) |
| contour | ✗ | No | ENQ (0x05) not handled; no answerback functionality found |
| foot | ✗ | No | No implementation found in action_execute() |
| Ghostty | ✓ | v1.0.0 | Handled in stream.zig:766 as C0.ENQ (0x05) |
| iTerm2 | ✓ | Yes | |
| Kitty | ✗ | No | |
| Konsole | ✓ | Yes | Calls reportAnswerBack() |
| mintty | ✓ | Yes | Handled in do_ctrl() at src/termout.c:1709-1714, sends answerback string |
| mlterm | ✗ | No | No ENQ/answerback implementation found |
| PuTTY | ✓ | 0.45 | Sends configurable answerback string |
| Rio | ✗ | No | Control code defined but not handled in execute() |
| rxvt-unicode | ✓ | rxvt-unicode-1.2 | |
| st | ✗ | No | Explicitly ignored (st.c:2246) |
| terminology | ✗ | No | Not implemented |
| VT100 | ✓ | Yes | |
| VTE | ✗ | No | Recognized but no-op for security reasons |
| WezTerm | ✓ | Yes | Handled in performer.rs:473 via ControlCode::Enquiry, responds with configurable answerback string |
| Windows Terminal | ✓ | Yes | Handled via EnquireAnswerback() dispatch in OutputStateMachineEngine.cpp:53-54 |
| xterm | ✓ | Yes | Implemented in charproc.c:3674. Returns answerback string |
| xterm.js | ✗ | No | Not implemented, no handler registered |
| Multiplexers | |||
| cy | ✗ | No | No handler for 0x05 |
| GNU Screen | ✗ | No | ENQ (0x05) is not handled as answerback; only used in OSC strings |
| tmux | ✗ | No | ENQ (0x05) is ignored, in range 0x00-0x06 with NULL handler |
| tuios | ✗ | No | |
| Zellij | ✗ | No | |
See also
- DA1 — Primary Device Attributes — Modern terminal identification mechanism