~/blog/terminal/

Terminal

Building a terminal UI from scratch in C, without libraries: how terminals work under the hood, from TTYs and byte streams to the escape sequences that draw on screen.

parts, read in order
4
minutes to read it all
167
written
2026-11

the parts

  1. What exactly is a terminal?

    2026-11-25#terminal#libterm#c19 min

    Explore the fundamentals of terminal programming, from TTY, PTY, and standard streams to character encoding and ANSI escape sequences. Learn how terminals work under the hood and build your first terminal UI from scratch using C, without external libraries.

  2. Escape Sequence [Part 2]

    2026-11-28#terminal#libterm#c48 min

    How a CSI sequence is built, The goal is to split any CSI sequence into its parts, then build the cursor-position command (CUP, ESC[row;colH) in C the way [libterm](https://github.com/rizukirr/libterm) does

SUMMARY OF COMMANDS

e
write an email
g
open GitHub
/
search projects or posts
h
show or hide this help
j, k
next or previous section (home)
q
back to the blog (on a post)
tab
next category (in an empty search box)
1 to 9
open a published project
esc
clear search, close this help