Skip to content

Console terminal state

include/console/term.h View source View on GitHub
struct term_geometry {
    uint16_t  rows;
    uint16_t  cols;
};
enum term_sev {
    TERM_SEV_NORMAL,
    TERM_SEV_DIM,
    TERM_SEV_LABEL,
    TERM_SEV_OK,
    TERM_SEV_WARN,
    TERM_SEV_CRIT,
    TERM_SEV_HEAD,
};
bool term_probe(void);
bool term_available(void);
struct term_geometry term_size(void);
void term_geometry_set(uint16_t rows, uint16_t cols);
void term_set_plain(bool plain);
bool term_plain(void);
void term_set_unicode(bool unicode);
bool term_unicode(void);
const char * term_style(enum term_sev sev);
const char * term_style_reset(void);
void term_enter_panic(void);
bool term_in_panic(void);
#define TERM_PROBE_TIMEOUT_MS 250
#define TERM_FALLBACK_ROWS 25
#define TERM_FALLBACK_COLS 80