ENUM VC_CTL_STATE(9)
π enum vc_ctl_state β bestie's guide to vt control-char states
okay so this is from the Kernel API Manual and it is literally the state machine of a virtual terminal's parser, like... the whole "what am I looking at right now" of escape sequences. no cap, it's giving main character energy in drivers/tty/vt. π
β¨ NAME β¨
enum vc_ctl_state β the control characters state of a vt π¦
πΈ SYNOPSIS πΈ
enum vc_ctl_state {
ESnormal ,
ESesc ,
ESsquare ,
ESgetpars ,
ESgetsubpars ,
ESfunckey ,
EShash ,
ESsetG0 ,
ESsetG1 ,
ESpercent ,
EScsiignore ,
ESnonstd ,
ESpalette ,
ESosc ,
ESANSI_first ,
ESapc ,
ESpm ,
ESdcs ,
ESANSI_last
};
like, that's the whole enum bestie, every single member, no skips π
π₯ Constants π₯
here's the tea on every single one of them, we're not leaving a single state out π
ESnormalβ the initial state, where no control characters are parsed. we're just vibing, nothing has happened yet πESescβESChas been parsed β¨ESsquareβCSIhas been parsed, so now it's waiting on modifiers / parameters / ctrl chars πESgetparsβCSIhas been parsed, and it's expecting parameters / ctrl chars πESgetsubparsβCSI mhas been parsed, and now it expects subparameters π«ΆESfunckeyβCSI [has been parsed πEShashβESC #has been parsed βESsetG0βESC (has been parsed πESsetG1βESC )has been parsed πΈESpercentβESC %has been parsed πEScsiignoreβCSI [0x20-0x3f]has been parsed πESnonstdβOSChas been parsed πESpaletteβOSC Phas been parsed πESoscβOSC [0-9]has been parsed β¨ESANSI_firstβ the first state for ignoring ansi control sequences π§ESapcβESC _has been parsed π¦ESpmβESC ^has been parsed π₯ESdcsβESC Phas been parsed πESANSI_lastβ the last state for ignoring ansi control sequences π
π¦ SEE ALSO π¦
kernel file ./drivers/tty/vt/vt.c plus the whole friend group: vc_font_pitch(9), vc_font_size(9), vc_do_resize(9), __vc_resize(9), vt_resize(9), vc_sanitize_unicode(9), vc_translate_unicode(9), vt_kmsg_redirect(9), con_is_bound(9), con_is_visible(9), con_debug_enter(9), con_debug_leave(9), do_unregister_con_driver(9) β go read them, iykyk π
and that's the whole thing bestie, sourced fresh from ./drivers/tty/vt, dated October 2026, iconically versioned as enum vc_ctl_state(9) β periodt π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms