Skip to main content

Module input_forwarding

Module input_forwarding 

Source
Expand description

Input forwarding: key events to ANSI sequences. Input forwarding for PTY processes.

Converts keyboard input events into ANSI escape sequences for terminal input.

§Invariants

  1. UTF-8 validity: All output sequences are valid UTF-8 or raw bytes.
  2. Modifier precedence: Ctrl > Alt > Shift in key transformation.
  3. Bracketed paste: Paste content is wrapped when mode is enabled.

§Failure Modes

FailureCauseBehavior
Invalid keyUnsupported key codeReturns empty sequence
Encoding errorNon-UTF8 charSilently dropped

Structs§

BracketedPaste
Wrapper for bracketed paste.
InputForwarder
Input forwarder that manages state and writes to a PTY.
KeyEvent
A keyboard event with key and modifiers.
Modifiers
Keyboard modifiers.

Enums§

Key
Key codes for keyboard input.

Functions§

key_to_sequence
Converts key events to ANSI escape sequences.