libvt.modes¶
ANSI standard and DEC private terminal mode definitions.
-
class libvt.modes.DecrpmValue¶class libvt.modes.DecrpmValue¶
Bases:
IntEnumDECRPMstatus codes returned inCSI ? Ps ; Pm $ yreplies.
-
class libvt.modes.Mode¶class libvt.modes.Mode¶
Bases:
IntEnumANSI standard modes and DEC private modes (
0x8000 | code).
-
class libvt.modes.ModeState¶class libvt.modes.ModeState¶
Bases:
objectMutable set of active ANSI and DEC private modes.
-
libvt.modes.is_private_mode_supported(mode, profile)¶libvt.modes.is_private_mode_supported(mode, profile)¶
Return
Truewhen DEC private mode is supported by profile.- Parameters:
- Returns:
Truewhenprivate_mode_unsupported_status()returnsNone.- Return type:
Examples
>>> from libvt.config import DEFAULT_PROFILE, Profile, ScreenBehavior >>> from libvt.modes import Mode, is_private_mode_supported >>> is_private_mode_supported(Mode.DECLRMM, DEFAULT_PROFILE) True >>> is_private_mode_supported( ... Mode.DECLRMM, Profile(screen=ScreenBehavior(declrmm_enabled=False)) ... ) False
-
libvt.modes.private_mode_unsupported_status(mode, screen)¶libvt.modes.private_mode_unsupported_status(mode, screen)¶
Return forced
DECRPMstatus when mode is unsupported, elseNone.Single source of truth for profile-gated DEC private modes across
ModeState.set_mode()interception,DECSET/DECRST,XTSAVE/XTRESTORE, andDECRQMqueries.- Parameters:
mode (
Mode) – DEC private mode to evaluate.screen (
ScreenBehavior) – Active profile screen behavior configuration.
- Returns:
DecrpmValue.PERMANENTLY_RESETorDecrpmValue.NOT_RECOGNIZEDwhen screen disables mode, otherwiseNone.- Return type:
References
Examples
>>> from libvt.config import DeccolmBehavior, ScreenBehavior >>> from libvt.modes import DecrpmValue, Mode, private_mode_unsupported_status >>> private_mode_unsupported_status( ... Mode.DECCOLM, ScreenBehavior(deccolm=DeccolmBehavior.CLEAR_ONLY) ... ) <DecrpmValue.PERMANENTLY_RESET: 4> >>> private_mode_unsupported_status(Mode.DECLRMM, ScreenBehavior()) is None True