nx_tty.nx
buildroot/runtime/nx_tty.nx
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
imports: syscalls.nxruntime.nxnx_axioms.nx
imported by: nx_tty_test.nx
structs
| none |
consts
| 36 | const NX_TTY_FG_BLACK: i64 = 30 |
| 37 | const NX_TTY_FG_RED: i64 = 31 |
| 38 | const NX_TTY_FG_GREEN: i64 = 32 |
| 39 | const NX_TTY_FG_YELLOW: i64 = 33 |
| 40 | const NX_TTY_FG_BLUE: i64 = 34 |
| 41 | const NX_TTY_FG_MAGENTA: i64 = 35 |
| 42 | const NX_TTY_FG_CYAN: i64 = 36 |
| 43 | const NX_TTY_FG_WHITE: i64 = 37 |
| 44 | const NX_TTY_FG_DEFAULT: i64 = 39 |
| 47 | const NX_TTY_BG_OFFSET: i64 = 10 |
functions
| 52 | func nx_tty_clear() -> i64 called by 1: main |
| 57 | func nx_tty_clear_line() -> i64 |
| 62 | func nx_tty_cursor_at(row: i64, col: i64) -> i64 |
| 91 | func nx_tty_cursor_home() -> i64 called by 1: main |
| 95 | func nx_tty_cursor_hide() -> i64 |
| 99 | func nx_tty_cursor_show() -> i64 |
| 106 | func nx_tty_reset() -> i64 |
| 111 | func nx_tty_bold() -> i64 |
| 116 | func nx_tty_underline() -> i64 called by 1: main |
| 121 | func nx_tty_inverse() -> i64 called by 1: main |
| 126 | func nx_tty_fg(color: i64) -> i64 |
| 145 | func nx_tty_bg(color: i64) -> i64 |
| 152 | func nx_tty_say(color: i64, s: *u8) -> i64 |
| 160 | func nx_tty_announce(color: i64, s: *u8) -> i64 |