Companion
Helper methods for constructing and decoding packed input mode snapshots.
Functions
Resolves the unmodified legacy Backspace selection. An explicit DECBKM override takes precedence over the host's current configured default.
Returns the packed format-other-keys mode value from bits.
Whether mode 1007 permits alternate-screen wheel-to-cursor-key input. Defaults to true.
Returns true when application cursor keys mode is enabled in bits.
Returns true when application keypad mode is enabled in bits.
Returns whether DECBKM has explicitly overridden the input profile's initial Backspace policy in bits.
Returns the explicit DECBKM wire selection from bits.
Returns true when bracketed paste mode is enabled in bits.
Returns true when focus reporting mode is enabled in bits.
Returns true when new-line mode is enabled in bits.
Whether XTSHIFTESCAPE requests Shift in mouse reports. Defaults to false.
Reads an XTFMTKEYS format (0 or 1), or -2 for an unsupported resource.
Reads an XTMODKEYS resource from the same snapshot as all other input modes. Returns -1 for explicit disable and -2 for an unsupported resource identifier. Cursor/function resources default to 2; all other resources default to 0.
Returns the packed Kitty keyboard progressive-enhancement flags from bits.
Returns the packed modify-other-keys mode value from bits.
Returns the packed mouse encoding mode ordinal from bits.
Returns the packed mouse tracking mode ordinal from bits.
Returns bits with one XTMODKEYS resource replaced, preserving all other bits. This pure primitive operation does not publish or mutate an input state. A zero word encodes defaults: 2 for cursor/function keys and 0 otherwise. Use those values to restore an individual resource to its default.