How terminals work
Modern terminal emulators are software programs that simulate physical hardware terminals. They maintain an internal grid of character cells (typically 80×24 or larger) and render each cell using a monospace font. Understanding this grid-based model is fundamental to terminal animation.
// A terminal is essentially a 2D grid
// Each cell contains:
// - A character (ASCII or Unicode)
// - Foreground color
// - Background color
// - Text attributes (bold, italic, underline, etc.)
// Example: 80 columns × 24 rows = 1,920 cells
const COLS = 80
const ROWS = 24
const grid = Array(ROWS).fill(null).map(() =>
Array(COLS).fill({ char: ' ', fg: 7, bg: 0 })
)