Skip to content

Pinned status bar

include/console/statusbar.h View source View on GitHub
void status_bar_open(void)
source

This is the only place that moves the cursor. DECSTBM (CSI top;bottom r) shrinks the region that scrolls, and CUP (CSI row; col H) addresses the row left outside it, so the bar stays pinned while log output scrolls above it.

We borrow the line writer for report.h to build the text

void status_bar_close(void)
source
void status_bar_set(const char *fmt)
source
void status_bar_progress(
    size_t done,
    size_t total,
    const char *detail_fmt
)
source

[####----] 34/120 (28%) <detail…>, painted onto the bar

void status_bar_progress_timed(
    size_t done,
    size_t total,
    time_ms_t test_started_ms,
    time_ms_t total_started_ms,
    const char *detail_fmt
)
source
void status_bar_reset(void)
source

Hand the whole screen back: drop the scroll region, forget the bar