How miheel/tinycurs works
This is a small terminal UI/runtime example: the main loop reads keyboard input, updates a movable on-screen figure, and redraws terminal content until Enter exits. The runtime also contains reusable pane and element rendering abstractions, terminal-mode management, resize signaling, and ANSI escape-code utilities. The README is empty, and the tree lacks the stick-figure and parse headers included by main, so those implementation details are not represented; links below are limited to shown source or header declarations.
Main entry points: main.cpp Interactive loop · keyboard.cpp Keyboard input · pane.cpp Pane buffer · curs.cpp Screen manager
Components 12
Application
- Interactive loop
src/main.cpp
Input
- Keyboard input
src/keyboard.cpp - Input events
include/keyboard.hpp - Resize signal
src/signalHandler.cpp
Rendering
- Screen manager
src/curs.cpp - Pane buffer
src/pane.cpp - UI elements
src/element.cpp - Cells and geometry
include/util.hpp
Terminal Runtime
- Terminal modes
src/termmode.cpp - ANSI controls
include/esc_code.hpp
Other components
- Terminal user
- Terminal
Connections 16
- Terminal user → Keyboard input: provides input
src/keyboard.cpp - Keyboard input → Terminal: reads bytes
src/keyboard.cpp - Keyboard input → Input events: queues events
src/keyboard.cpp - Keyboard input → Resize signal: checks resize
src/keyboard.cpp - Interactive loop → Keyboard input: polls keys
src/main.cpp - Interactive loop → Screen manager: updates screen
src/main.cpp - Interactive loop → Terminal modes: sets terminal mode
src/main.cpp - Interactive loop → Resize signal: registers handler
src/main.cpp - Screen manager → Pane buffer: draws pane
- Screen manager → Terminal modes: manages terminal
- Pane buffer → UI elements: renders elements
src/element.cpp - UI elements → Pane buffer: writes buffer
src/element.cpp - Pane buffer → Cells and geometry: stores cells
- Terminal modes → Terminal: configures terminal
src/termmode.cpp - Interactive loop → Terminal: writes display
src/main.cpp - ANSI controls → Terminal: emits controls
include/esc_code.hpp