Minimum Effort

minimum-effort is the smallest full-screen demo in the repository. It shows how quickly you can go from a fresh terminal session to a framed layout with colored text, direct buffer drawing, and a clear title.

Use This Demo When You Need…

  • A tiny starting point for a new project that still feels like a complete terminal application.

  • The shortest possible example of Terminal setup, one persistent Buffer, and one write() call.

  • A support reference for simple drawFrame() plus drawText() composition without any application framework.

Run the Demo

Start the demo from the build directory:

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

The program renders one framed screen and exits immediately. The current title says 15 Lines of Code, so the page uses that wording consistently.

Captured Output (80x25)

┌─────────────────────────────────────────────────────────────────────────────┐
│                                                                             │
│                                                                             │
│                       Demo with Only 10 Lines of Code                       │
│                                                                             │
│  auto main() -> int {                                                       │
│      Terminal term{Size{80, 24}};                                           │
│      TerminalSession session{term};                                         │
│      Buffer buffer{term.size().componentMin({200, 24})};                    │
│      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 10 Lines of Code",                     │
│          titleRect, Alignment::Center, Color{fg::BrightYellow});            │
│      term.write(buffer);                                                    │
│      return 0;                                                              │
│  }                                                                          │
│                                                                             │
│                                                                             │
│                                                                             │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Features Demonstrated

  • Terminal initialization, one-screen rendering, and cleanup.

  • One retained Buffer with fill(), drawFrame(), and drawText().

  • A centered title rectangle derived from the full buffer geometry.

  • A self-documenting screen that embeds the demo source directly in the rendered output.

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.