code wiki / (root) / nx_tty.nx

nx_tty.nx

buildroot/runtime/nx_tty.nx

4818 B167 linesdepth 4pulls 5 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_tty.nx -- terminal output primitives (ANSI escape sequences). The user-interaction layer's OUTPUT side. Writes ANSI escape sequences to stdout (fd=1) for cursor positioning, color, screen clearing, attribute changes. Pure i64 + sys_write; no libc. Why this exists (per user 2026-05-13): "trace all the way from the hardware bits electrical impulses up through the math physics function objects programs to the user interaction" Closes the substrate-to-user gap that the generational audit surfaced (Gen 0-8 covered code; Gen "UI" was absent). Compatible with: xterm, gnome-terminal, kitty, alacritty, VS Code terminal, Windows Terminal, every VT100-derived TTY. genealogy_id: ecma_48_1976_ansi_escape + vt100_1978_terminal + xterm_extensions lineage_id: escape_sequence_emission_to_fd_stdout axioms: NX_AX_LOGIC_IDENTITY (each escape sequence is a well-defined glyph -> behavior mapping)

dependencies 3 imports · 1 importers

syscalls.nx runtime.nx nx_axioms.nx nx_tty.nx nx_tty_test.nx

imports: syscalls.nxruntime.nxnx_axioms.nx

imported by: nx_tty_test.nx

structs

none

consts

36const NX_TTY_FG_BLACK: i64 = 30
37const NX_TTY_FG_RED: i64 = 31
38const NX_TTY_FG_GREEN: i64 = 32
39const NX_TTY_FG_YELLOW: i64 = 33
40const NX_TTY_FG_BLUE: i64 = 34
41const NX_TTY_FG_MAGENTA: i64 = 35
42const NX_TTY_FG_CYAN: i64 = 36
43const NX_TTY_FG_WHITE: i64 = 37
44const NX_TTY_FG_DEFAULT: i64 = 39
47const NX_TTY_BG_OFFSET: i64 = 10

functions

52func nx_tty_clear() -> i64
called by 1: main
57func nx_tty_clear_line() -> i64
62func nx_tty_cursor_at(row: i64, col: i64) -> i64
called by 1: main calls 1: itoa
91func nx_tty_cursor_home() -> i64
called by 1: main
95func nx_tty_cursor_hide() -> i64
99func nx_tty_cursor_show() -> i64
106func nx_tty_reset() -> i64
111func nx_tty_bold() -> i64
called by 2: nx_tty_announcemain
116func nx_tty_underline() -> i64
called by 1: main
121func nx_tty_inverse() -> i64
called by 1: main
126func nx_tty_fg(color: i64) -> i64
145func nx_tty_bg(color: i64) -> i64
called by 1: main calls 1: nx_tty_fg
152func nx_tty_say(color: i64, s: *u8) -> i64
called by 1: main calls 3: nx_tty_fgprintnx_tty_reset
160func nx_tty_announce(color: i64, s: *u8) -> i64