encodeTextReplacement
Encodes a complete text replacement under one outbound lock acquisition.
Delete, Backspace, and paste bytes cannot interleave with keyboard input or parser/core responses from this session.
Parameters
event
deletion counts and replacement text.