ENUM VC_CTL_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” ESC has been parsed ✨
  • ESsquare β€” CSI has been parsed, so now it's waiting on modifiers / parameters / ctrl chars πŸ‘€
  • ESgetpars β€” CSI has been parsed, and it's expecting parameters / ctrl chars πŸ™ˆ
  • ESgetsubpars β€” CSI m has 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 β€” OSC has been parsed πŸ’œ
  • ESpalette β€” OSC P has 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 P has 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