[1.7.1] - 2026-12-02
Fixed
- macOS
CMSG_SPACE/CMSG_LENVisibility (src/libaxil-tty.c): - Defined
_DARWIN_C_SOURCE 1instead of_XOPEN_SOURCE 700on__APPLE__so BSDcmsgmacros remain visible in<sys/socket.h>on Apple SDKs.
[1.7.0] - 2026-12-02
Added
- Jailed PTY Spawner Worker with
SCM_RIGHTS& Policy Rails (include/ttypt/axil-tty-privsep.h,src/tty-privsep-crypto.h,src/libaxil-tty.c): - Added privilege-separated PTY spawner worker (
tty_privsep_start_with_key(),tty_privsep_stop(),tty_privsep_request_shell(),tty_privsep_request_man(),tty_privsep_request_kill(),tty_privsep_policy_check_pw(),tty_privsep_validate_man_arg()) passing allocated PTY master descriptors back overSCM_RIGHTSafter verifying HMAC TTY tickets and login-shell policy rails (5664ce8).
Security
- Refuse Cross-UID Shell Spawn When Non-Root (
src/libaxil-tty.c): - Refused spawning login shells for a different UID when running without root privileges (
ac0f0f2).
[1.6.7] - 2026-12-02
Fixed
- NPM Package Version Parity (
package.json,axil-tty.pc): - Synced root
package.jsonversion with release tag (1.6.7) alongside OpenBSD wildcard@dependpackaging.
[1.6.6] - 2026-12-02
Changed
- OpenBSD Wildcard Dependency Packaging:
- Repackaged with wildcard OpenBSD
@dependspecifications (axil-*,libcorm-*,libxylem-*,libstele-*) viatty-pt/ciso downstream OpenBSD packages resolvelibcorm 2.5.2+andaxil 1.9.1+cleanly without exact-version pin conflicts.
[1.6.5] - 2026-12-02
Fixed
- Windows
TELNET_CMDFallback (src/libaxil-tty.c): - Defined
#ifndef TELNET_CMDfallback overaxil_write()(sinceaxil.hguardsTELNET_CMDunder#ifndef _WIN32) and guardedmux_wsz_get()under#ifndef _WIN32for clean MinGW64 compilation.
[1.6.4] - 2026-12-02
Added
- Windows (
winget+ Scoop) Port (src/libaxil-tty.c,Makefile,.github/workflows/ci.yml): - Guarded POSIX PTY/passwd headers and APIs (
<grp.h>,<pwd.h>,<pty.h>,<termios.h>,<sys/ioctl.h>,<sys/wait.h>,posix_openpt,fork,waitpid,kill) under#ifndef _WIN32with astruct winsizefallback so telnet negotiation (axil_tty_attach,axil_tty_input, NAWS) and browser terminal asset routes build and run cleanly on MinGW64 while PTY spawning fails closed withENOSYS. - Added
LDLIBS-libaxil-tty-Windows := -lstele -lws2_32,LDFLAGS-libaxil-tty-Windows := -Wl,--export-all-symbols, and enabledwingetin CI (9/9platforms).
[1.6.3] - 2026-12-02
Fixed
- iOS SDK Build Compatibility (
src/libaxil-tty.c): - Guarded
<arpa/telnet.h>via__has_includewith RFC 854/855/1073 byte fallbacks (IAC,DONT,DO,WONT,WILL,SB,SE,TELOPT_ECHO,TELOPT_SGA,TELOPT_NAWS), guarded<util.h>andsetgroups/initgroupsonTARGET_OS_IPHONE, and returned-1(ENOSYS) fromcommand_pty()on iOS wherefork()/execve()are prohibited by the iPhoneOS SDK.
[1.6.2] - 2026-12-02
Added
- Mobile Static Libraries (
android-lib+ios-lib) (.github/workflows/ci.yml): - Enabled Android (
arm64-v8a,x86_64) and iOS (arm64device/simulator +libaxil-tty.xcframework.zip) static library packaging and publishing (5517829,f430940). - Runtime
stele:tty_*Capability Registration (htdocs/axil-tty-cap.js): - Registered
stele:tty_*main-thread and worker-thread capability handlers directly vialibstele's runtime handler hooks (registerSteleMainHandler/registerSteleWorkerHandler), decoupling terminal transport from Layer-0libstele(64d46c5).
Fixed
- Tick Handler Self-Gating (
src/libaxil-tty.c): - Self-gated
on_axil_tick()when a file descriptor is not present inmux_pty_map(aa93853). - DOM Remount Scrollback & Detached Mount Guard (
htdocs/axil-tty-cap.js): - Preserved bounded session scrollback (
256chunks /32 KiB) across DOM remounts viarecordScrollback()/replayScrollback()and guarded against attaching to detached DOM nodes (159fc53). - PTY Child Environment Buffer Sizing (
src/libaxil-tty.c): - Expanded
home,user, andshellenvironment string buffers incommand_pty()toBUFSIZ + 16to accommodateHOME=,USER=, andSHELL=prefixes without truncation (b0e2fbc).
Removed
- Redundant Browser Bridge Files (
htdocs/): - Removed duplicate
htdocs/axil-tty-bridge.jsandhtdocs/tty-cap.js, consolidating onhtdocs/axil-tty-cap.js(50f5249).
Changed
- Portable
libstele/mkBuild Modernization (Makefile,Doxyfile): - Migrated to
include ttypt/include.mkvia Make search paths, dropped legacy../mkfallback, adoptedCFLAGS-LIB/CFLAGS-BIN, and ported Makefiles to OpenBSD + GNU Make (f0464b0,e204939,d65209f,9377eb1,e74fac5,000c3f7). - Standardized npm Metadata (
package.json,README.md): - Standardized author,
BSD-2-Clauselicense, and README metadata (aeae6ef).
[1.6.1] - 2026-11-16
Changed
- Arch Linux (
pacman) Packaging (.github/workflows/ci.yml): - Added
pacmantopublish_toanddeps_pacman: "axil,libcorm,libxylem,libstele"soaxil-ttypublishes across all 6 Unix OS targets (deb,apk,rpm,pacman,brew,openbsd).
[1.6.0] - 2026-11-13
Added
- Web HAL Bridge & TerminalController Exports (
package.json,htdocs/,types/,cjs/): - Exported standard capability bridge (
createAxilTtyBridgeunder@tty-pt/axil-tty/bridge), standalone Web HAL capability registration modules (htdocs/axil-tty-cap.jsandhtdocs/tty-cap.js), andTerminalControllerunder@tty-pt/axil-ttywith SSR/Node-safe dynamic@xterm/xtermloading. - Added CommonJS distribution wrapper in
cjs/axil-tty.js. - Added TypeScript definitions in
types/axil-tty.d.tsandtypes/bridge.d.ts. - Untracked gitignore entries to ensure
htdocs/,cjs/, andtypes/are committed and tracked.
Fixed
- DOM Container Lifecycle & Write Buffering:
- Enhanced DOM container unmount and remount lifecycle in
htdocs/axil-tty-bridge.js. - Added write buffering (
pendingWriteBuf) during detached or pending bridge states to prevent early terminal write drops before mount.
Changed
- Replaced legacy logging comments with stllog and cleaned dependencies.
[1.5.0]
- Pure TTY Capability Bridge (
htdocs/axil-tty-bridge.js): - Modularized browser terminal capability bridge consuming the generic
axil-bridge.jstransport bus. - Integrated local
@xterm/xtermsupport and terminal resizing over WebSocket. - Synchronized WASM allowed imports list (
wasm-allowed-imports.lst).
[1.4.0]
- Debut Synchronized Public Release: Official public release of the WebSocket-to-PTY terminal streaming bridge module for Axil.
- Fail-Closed Terminal Access Security:
tty_identity()resolves caller credentials fresh per request and enforces strict authentication checks (DF_AUTH_AUTO/ unauthenticated descriptors rejected). - Generation-Validated Mux State: Full generational tracking on connection descriptors preventing fd reuse race conditions.
- Telnet NAWS Window Resizing & PTY Bridge: Automatic terminal resizing, ECHO and SGA negotiation, and browser terminal assets (
axil-tty.js,axil-tty.css).
[1.3.2]
- Fail closed on unauthenticated or automatic
-Aterminal access. Who may
have a terminal is now resolved fresh for every request by tty_identity(), and it is deliberately not axil_get_pw(): that call substitutes the server's own entry for any unauthenticated descriptor, and three call sites used to treat the substitution as the caller's identity. Now an unauthenticated descriptor, a -A-published identity (DF_AUTH_AUTO), and a name with no passwd entry all resolve to NULL โ no identity, no terminal. tty_no_shell() refuses the known no-op shells (false, nologin, /bin/false, /usr/bin/false, /sbin/nologin, /usr/sbin/nologin) and counts anything unrecognised as a real shell: it is a deny-list on purpose, because the failure that must never happen is a no-shell account treated as shellable. tty_refuse() answers with one log line and one client line โ the text travels as a WebSocket frame, so even a browser sees why before the close โ and there is no PTY, no fork. drop_priviledges() now takes the resolved identity and refuses the child when there is none, and mux_init() tolerates a chroot with no /etc/passwd (empty mux_pw, nothing dereferences it).
- Generation-validated mux state; HTTP bypass (S5.4/S5.5).
mux_stateand
the NAWS entry carry the connection generation and mux_get()/mux_wsz_get() refuse a mismatch, so a leaked entry is inert on a recycled fd instead of handing the next connection a live shell. Chunks that open with an HTTP request line skip telnet processing entirely โ a 0xFF body byte used to be read as IAC, which slid the request head off the input and answered the POST with the telnet banner (shell bytes ride WebSocket frames and still reach the PTY, so the exemption is only for the HTTP case). AXIL_TTY_TRACE logs PTY handover instead of doing it silently, and the build now uses the in-tree axil headers.
- Tests:
test.shasserts an unauthenticated/ttyyields no PTY, no
child and no output โ only a refusal line, a close and a log entry โ and keeps the retained regression that an authenticated PTY connection killed abruptly still cleans up.
npm installno longer runsmake. Thepostinstallhook built
lib/libaxil-tty.so inside node_modules, but an npm consumer has no sibling ../mk checkout to satisfy -include ./../mk/include.mk โ it resolves to node_modules/@tty-pt/mk, which is not a dependency of this package and does not exist, so every consumer install died with make: no target to make. Nothing consumes that node_modules copy anyway: host builds link the sibling checkout or the system-installed libaxil-tty.so. Native builds stay in the checkout's own make.
[1.3.1]
axil_tty_handle_tty(cfd, body)is exported (it was the static
handle_tty): a host module that embeds this one โ axil-nd โ can register the GET:/tty route itself instead of depending on the nested xy_load() that installed it as a side effect. axil_register_handler() is last-wins, so registering from both places is safe.
[1.3.0]
- Opt-in line mode for routes with no line discipline (
lineMode). A game
socket says WONT ECHO and runs no PTY, so per-keystroke frames used to hit the game command parser one character at a time (and a bare Return died in cmd_new). With lineMode: true, the client holds the line while the server says WONT ECHO and submits one "<line>\n" frame per Enter -- the same shape sendCmd() uses -- with local echo, code-point-aware erase, pasted CRLF split into one submit per line, and escape-led input swallowed. The moment the server says WILL ECHO (a PTY is born: sh, man, /tty) the branch goes inert and every keystroke reaches the driver immediately, so there is still exactly one echoer in both states. Off by default; /tty behaviour is unchanged.
[1.2.1]
- Reverted
b0485b0's second hunk:shspawns the login shell again.
That commit meant to harden the empty-passwd fallback but changed axil_tty_shell from {NULL, NULL} to {"/bin/sh", NULL}, which bypasses command_pty()'s whole pw_shell โ mux_pw โ /bin/sh chain โ every sh landed in dash, a canonical-mode reader with no line editing, where arrow keys arrived as raw escape bytes (cursor jumps plus garbage in the buffer, since ECHOCTL stays off). Passing NULL restores the login shell (/bin/bash here, readline, working history) while keeping the first hunk's empty-field hardening intact.
- Fixed: nothing was echoed as you typed. 1.2.0 (
66631d2, "axil-nd
compat") rewrote the browser client to impersonate a line discipline: buffer every keystroke into term.inputBuf, send the line only at Enter, and echo locally only when the server had said WONT ECHO. But this module has always negotiated WILL ECHO and created PTYs with the OS default c_lflag, which has ECHO set -- so the local-echo branch was unreachable and the client was withholding the bytes until Enter, leaving the driver nothing to echo in the meantime. The screen stayed blank until the line was submitted. The client is a pipe again: every keystroke goes out as it is typed, and the line discipline does the echoing, line editing, ^? erase and CR/LF translation, which is what a real terminal is.
- The three PTY creation sites now share one
mux_pty_termios()helper, which
also closes a real gap: mux_ensure() never touched c_oflag at all, and that is the path a raw-telnet sh guest takes, so its output arrived as bare LFs -- the staircase you get when a terminal steps down a line without returning to column 0. The helper sets ICRNL, clears IGNCR/INLCR, sets OPOST/ONLCR and clears OCRNL everywhere.
- One echo owner per session, stated at connect and never revisited.
WILL ECHO goes out on connect and again after the child exits, and that is the only time the policy is stated. axil_tty_update() is gone: it re-read the lflag on every PTY output and told the client WONT ECHO the moment a program cleared ECHO, which for any client that honours it means local echo landing on top of a program that is about to render the line itself -- vim would show every keystroke twice and its cursor would drift from the real one. Two echoers is the one failure nobody can recover from, so there is never a second one. This is also why the helper leaves ECHO alone: bash's readline only echoes at all when it inherits ECHO on, and it takes the tty out of canonical mode to do its own line editing, so sh, bash and vim each end up with exactly one echoer between them.
- Accepted trade-off: a program that clears
ECHOand then expects its peer to
echo for it will show nothing. That set is smaller than the bash case above, it is what 1.1.x did, and no real terminal has that property either.
- The suite now asserts
WILL ECHO(and the absence ofWONT ECHO/WILL SGA),
that a partial line is echoed back before Enter -- the user-visible feature stated directly as a test, which fails under any policy where the client withholds bytes -- and that PTY output arrives CRLF-terminated.
[1.2.0]
- Fixed the arm64 macOS (Homebrew) build. The PTY child was spawned with
execvpe(3), a glibc extension (in POSIX.1-2008 TC1, but never implemented on Darwin) that only ever compiled because _GNU_SOURCE makes glibc declare it. Darwin ignores that macro, and clang โฅ15 treats the resulting implicit declaration as a hard error, so brew's arm64 job could not build the module at all. Replaced with plain execve(3) โ carrying the curated environment, with execvp(3) kept as the fallback โ matching axil's own convention that argv[0] is a full path (as in axil_posix popen2). No PATH search machinery is needed, as every caller passes an absolute path.
- The spawned shell now gets the environment we intended on macOS. Since
execvpe was missing there, Darwin fell through to execvp and silently discarded the whole env array, inheriting the server's environment instead. The child environment is now platform-aware: PATH prepends Homebrew's arm64 prefix (/opt/homebrew, since /usr/local is Intel's), and LD_LIBRARY_PATH becomes DYLD_LIBRARY_PATH (best-effort โ SIP strips it for SIP-protected binaries). Linux and the BSDs are unchanged.
- Fixed a fatal defect: standalone
GET:/ttydelivered no data. The handler
upgraded the socket but never called axil_fd_watch(). axil deliberately never routes WebSocket frames through on_axil_parse/cmd_parse โ frames reach a module only via axil_ws_read() after it watches the fd โ so the route negotiated at the transport layer and then never saw telnet options, NAWS, or PTY input. It only ever worked under axil-nd, which watches and reads the fd itself.
- Each connection now has exactly one reader.
handle_ttywatches the
client fd, on_axil_tick drains it with axil_ws_read() and feeds axil_tty_input(), and only for connections this module owns. Ownership is recorded in mux_state.owns_client and exposed as the new axil_tty_owns(fd) predicate, which axil-nd checks so that two loaded modules cannot split one socket's frame stream between their ticks.
- NAWS geometry no longer requires a live PTY. A client negotiates its
window size at socket-open, long before any command exists, so the size is now recorded in a dedicated fd โ winsize map that is independent of per-connection state; axil_tty_exec() seeds a new PTY from it. Entries are dropped on disconnect before the state lookup, since fd numbers are reused. axil_tty_input() also bounds-checks truncated telnet options.
on_axil_connectonly claimsGET:/tty(AXIL_TTY_ROUTE, the same
literal the route is registered with, so the two cannot drift). A connection on another route gets no negotiation, no O_NONBLOCK, no PTY and no state. Note this is defensive rather than load-bearing: loaded as a DT_NEEDED dependency of libaxil-nd.so, axil dispatches on_axil_connect to the primary module only, which was verified with an instrumented build.
create()merges a partialsubover the defaults (Object.assign)
instead of substituting it, so passing only some hooks no longer throws on sub.onOpen being undefined. The returned instance is now a copy, so mutating it no longer writes through to the caller's object.
onMessageis now optional intypes/axil-tty.d.ts, and the stale/terminal
default in the type docs is corrected to /tty.
- Renamed
ndc-ttyโaxil-tty: the module now integrates with the axil
HTTP/server library and its xy hooks; headers and build targets renamed accordingly.
axil_tty_exec(fd, argv)/axil_tty_shell(fd)โ replaces
ndc_tty_exec/ndc_tty_shell; opens a PTY and execs argv (argv[0] == NULL uses the user's login shell).
- Module artifact:
libaxil-tty.so(with alib/axil-tty.solink), loaded
via axil -m axil-tty; the module registers the GET:/tty WebSocket upgrade + PTY handler.
- NPM package:
ndc-ttyโ@tty-pt/libaxil-tty(axil-tty.js/axil-tty.css/
demo.js, axil-tty-cli.js bin, types/axil-tty.d.ts).
- JS assets renamed off
axilโaxilis the HTTP server, not this module,
so nothing on the JS side is named after it: the library axil.js โ axil-tty.js, the stylesheet axil.css โ axil-tty.css, the page bootstrap axil-tty.js โ demo.js, and the CLI shim axil-cli.js โ axil-tty-cli.js (the installed axil command is unchanged). The C handlers now serve GET:/axil-tty.js, GET:/axil-tty.css, and GET:/demo.js.
- Fixed the duplicate
createexport in the library that broke
bun run build.
- Default WebSocket URL is now
/tty(was/terminal), matching the route
the module actually serves; consumers no longer need to pass url.
- New
types/axil-tty.d.ts; thetypescondition inexportsnow comes
first so TypeScript resolves it. types is no longer gitignored.
- Dropped the
modulefield: it pointed atesm/axil-tty.js, which the
build never emitted (the esm target globs src/, which is C-only). ESM consumers use exports["."].import.
- Fixed
test.sh: the handshake request was built with$(printf โฆ)and
bash stripped its trailing newline, leaving the request unterminated, so the server never replied and the suite always failed with "axil did not become ready". Asset-route checks added.
- Fixed the
AXIL_HTDOCSasset-root override, which was read from the
per-connection request environment and so never saw the server's own environment; it is now read with getenv().
- Removed the unused
axil_tty_pw_free()(the only build warning). - Known limitation: over a WebSocket, axil never runs
cmd_parse, so the
registered sh command cannot be reached by name. Standalone /tty starts its shell from the first NAWS instead. axil-nd is unaffected โ its sh runs from its own command pipeline.
[1.0.1] - 2026-04-12
- TTY/PTY functionality extracted from ndc core into this standalone module.
- New:
ndc_tty_exec(fd, argv)โ replacesndc_pty(fd, args)from ndc
core; opens a PTY and execs argv on fd. argv[0] == NULL uses the user's login shell.
- New:
ndc_tty_shell(fd)โ replacesdo_sh; opens a PTY login shell on
fd.