Minimum Effort

minimum-effort is a deliberately tiny full-screen program that still shows a framed terminal layout, styled text, and a title. The demo exists to demonstrate how little code is needed before the library already feels productive.

It is a good starting point when you want a minimal example to copy into a fresh project.

Run the Demo

Start the demo from the build directory:

$ ./cmake-build-debug/demo-apps/minimum-effort

ANSI Output Example

The following capture shows the rendered frame and the embedded source code:

┌─────────────────────────────────────────────────────────────────────────────┐
│                                                                             │
│                                                                             │
│                       Demo with Only 14 Lines of Code                       │
│                                                                             │
│  auto main() -> int {                                                       │
│      Terminal term{Size{80, 24}};                                           │
│      term.initializeScreen();                                               │
│      Buffer buffer{term.size()};                                            │
│      buffer.fill(Char{' ', fg::BrightBlue, bg::Black});                     │
│      buffer.drawText(Position{3, 5}, cThisCode);                            │
│      buffer.drawFrame(buffer.rect(), FrameStyle::Light);                    │
│      auto titleRect = buffer.rect().subRectangle(Anchor::Top, {0, 3}, {3, 2}│
    buffer.drawText("Demo with Only 14 Lines of Code",                     │
│          titleRect, Alignment::Center, Color{fg::BrightYellow});            │
│      term.write(buffer);                                                    │
│      term.restoreScreen();                                                  │
│      return 0;                                                              │
│  }                                                                          │
│                                                                             │
│                                                                             │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Features Shown

This demo is intentionally compact, but it still touches the core workflow:

  • Terminal setup and teardown.

  • One persistent Buffer with a fill color.

  • drawFrame() and drawText() for a simple full-screen composition.

  • A self-documenting code sample rendered inside the frame.

Relevant Source Files

If you want to explore the implementation, start with:

demo/minimum-effort/src/main.cpp

The full demo lives in that one file.