Skip to main content

DEFAULT_ESC_TIMEOUT

Constant DEFAULT_ESC_TIMEOUT 

Source
pub const DEFAULT_ESC_TIMEOUT: Duration;
Expand description

Default escape-sequence timeout.

When the pending buffer holds a partial ESC-prefixed sequence or 8-bit C1 introducer and no continuation arrives within this window, the source asks the decoder to resolve the buffered bytes as best-effort events. This is how a physical Escape key is distinguished from an Alt-prefixed key or CSI-style control sequence. Fresh input resets the deadline while a sequence remains incomplete. Once bytes follow an OSC, DCS, APC, SOS, or PM introducer, the string waits for its terminator or an interrupting Escape sequence. Recognized clipboard headers switch to the separate clipboard idle timeout. An introducer alone still uses the Escape timeout. A timed-out two-byte introducer such as ESC ] resolves to Alt+].

Applications that prefer more responsive Escape handling can lower this value with EventSource::with_esc_timeout; applications that need to tolerate slow byte delivery can raise it.