Repository navigation
OpenTTY 1.18.1
Pre-release
Pre-release
OpenTTY Java Edition
Copyright (C) 2026 - Mr. Lima
Multi-tasking / process management
Processnow has its ownDisplayable screen(registered viaos.setproc("screen", ...)); the globalmidlet.stdout/midlet.stdinwere removed — each process has its own output buffer (per-processStringBuffer) and its own inputTextField- New per-process socket tracking (
Process.net) replaces the globalmidlet.network - New Task Manager
graphics.taskmngr()(aList"Running"usingList.IMPLICIT) listing every process as"title/name [pid]":- Back: if no processes remain, calls
destroyApp(closes the MIDlet), otherwise returns to the previous screen - Interrupt (SIGTERM): sends signal 15 to the selected process's
sighandlerand removes it from the list - SELECT: switches
display.setCurrent()to the process's screen (process switching)
- Back: if no processes remain, calls
os.setproc("title", ...)sets the title shown in the Task Manager (title [pid]instead ofname [pid])- Process scope is cloned by
cloneScope()inos.popen/serve, sosu/cdin one terminal no longer affect the others /bin/xterm(new): the terminal emulator was extracted frominit— it creates its own stdout/stdin/screen,[USER@HOST PWD] #/$prompt, "Run" command and "Switch to..." button (task manager); shows/etc/motdon open/bin/initsimplified: it only mounts fstab, sets env,os.su, callsos.execute("xterm"); also accepts--serve=<program>to spawn daemonsgraphics.display()clearskillwhen showing aDisplayable, keeping the runtime alive with a foreground screen- Allowed multiple terminals
ELF / network
- Full socket API restored in the ELF emulator:
bind: opensStreamConnectionNotifier/DatagramConnectionon the given port, returns-EADDRINUSEon conflictlisten: marks the socket as listening, with ephemeral-port fallbackaccept:acceptAndOpen, new fd with streams + peersockaddr_inreturned to the callersendto/recvfrom: DGRAM viaDatagramConnection, TCP via streams, with peer writebackshutdownandnanosleeprestored (success no-ops)
- Socket options:
setsockopt/getsockoptwith an options table (SO_REUSEADDR,SO_KEEPALIVE,SO_OOBINLINE,SO_BROADCAST,SO_DONTROUTE,SO_LINGER,SO_SNDBUF,SO_RCVBUF,TCP_NODELAY);SO_ERRORandSO_TYPE;-ENOPROTOOPTfor unsupported options - New constants:
SOL_SOCKET,SOL_IP,TCP_NODELAY,SO_*; new errorsENOTSOCK,ENOPROTOOPT,EADDRINUSE,EADDRNOTAVAIL,EISCONN - A failed
connectsetssocketInfo["error"] = 111 - ELF
listdirnow sees the virtual/proc/(pid entries,cpuinfo,meminfo,uptime,version) viamidlet.procEntries() - Shutdown cleanup also closes
datagramconnections
Filesystem / VFS / Proc
- Nested VFS under
/bin/,/etc/,/lib/: subdirectories are supported as RMS mounts, each mapping to its ownOpenRMSpage via a stable path hash (indices>= 9,VFS_HASH_MOD=97) - Read/write/delete resolve nested paths at any depth (
/bin/tools/sub/file.lua);io.dirsand ELFgetdentslist any/bin|etc|lib/...folder - Writing into a subdir auto-registers it in the VFS (
cd+lsdetect it);rmscan clear subdir stores (rm -r /bin/tools) - Declare subdirs in
/etc/fstabunder their parent line with a trailing/(e.g.tools/);addFilerefactored to operate on a store index - Persistence: VFS subdirs survive restarts via
/etc/vfs.conf(written on mkdir, removed on delete/rms, restored on mount) - Root's home is
/root/(OpenRMS index 6); regular users cannot read/write/enter it;rmsstays root-only;su,chdirand listing all enforce the rule - Virtual
/proc/:uptime,version,meminfo(nowRuntime.totalMemory, since CLDC lacksmaxMemory),cpuinfoand/proc/<pid>/withstatus,cmdline,comm,stat; regular users only see their own processes (root sees all) fstabupdated: addsroot/to the root mount, andmkdir,pkg,xtermto/bin/
Shell & commands
/bin/shcut from 284 → 32 lines: builtins are handled by the kernel/os.execute; preserves-c, file execution and interactive mode/bin/pkg(rewritten, v1.6.0): usessocket.http.get/rgetinstead of raw TCP; serverhttp://opentty.fun(REPOoverride); commandsinstall,remove,update,list,info,download,run; mirror with 50+ packages/bin/yangslimmed to a wrapper that forwards args topkg/bin/mkdir(new): creates VFS directories; root-only under/bin,/etc,/lib,/root/bin/luanow runs files directly (lua <file>)/bin/cpsupports a single-argument mode (cp filecopies tofile-copy)/bin/rmaccepts-r/-rf/-frand multiple files/bin/nano: "Add new line" button (for J2EMU) and "Switch to..." (task manager)/bin/curl: fixed URL parsing (sub(1,5)for"http:")- Add
#!/bin/shshebang support on. [file]run
New apps
xterm— terminal emulator (see multi-tasking)irc(apps/net/irc.lua) — IRC client with CLI (connect/send) and GUI modes, join/part/nick/PRIVMSG, PING/PONG, MOTDplay(apps/file/play.lua) — audio player (play/stop/pause/resume/status/volume/list) driving theaudio-codecdaemon; GUI modetree(apps/file/tree.lua) — directory tree viewer (-d,-L N,-a, counts)nginx(apps/net/nginx/main.lua) — nginx-style HTTP server: config/etc/nginx/nginx.conf,mime.types,sites-enabled/, static serving,proxy_pass, per-location alias, access/error loggingdns(apps/net/dns/main.lua) — DNS server daemon: reads/etc/hostsand/etc/dns/*.zone, answers A/AAAA/MX/CNAME, stats,lookup/add/remove/reload/listhead,tail,netstat— implemented (head/tail print the first/last N lines; netstat tests connectivity via HTTP GET)
Updated apps
jdb(apps/sys/benchmark/main.lua, +388 lines) — adb-style debug bridge:ps,getproc,dumpsys,logcat,users,crash,stack,meminfo,shell,connect(TCP/UDP client); server mode on port 5555sudo— now reads all args (arg[1]is the command, the rest are forwarded); executes as root and restores the original userdocker— expanded container management, images and init scriptshttpd(res/lua/modules/httpd.lua) — newhttpd.static(root_dir)function to serve static files with MIME detection
Lua runtime
- performance optimizations:
SMALL_NUMBERS[-128..1023]— cached smallDoubles for loops/indicesScopeTable(chained scope) instead of cloning the globals table on every function callStringBufferconcatenation; staticBoolean TRUE/FALSE; per-source tokenizer caching; early-returns ingetpattern/replace/escape
- errors / traceback: new
getTraceback(Throwable)emits aFramestack trace (name, source, line),pointerBlock()with^---and(near '<token>'), injected intorun(),pcall,os.requesthandlers, background threads and UI callbacks - new functions:
string.startswith,string.endswith,table.pack,graphics.taskmngr;os.setprocwith"screen","title","stdout"attributes os.scope()with no args returns the current scope; with a table, swaps the scope (father)os.executerefactored: support for>,&&, and&(background via the named classBGRunnerto avoid the preverifierNoClassDefFoundError)- Reading a file/stream with chunk size
-1reads until end of file/connection tonumberinvalid/missing-value message fixed
Package manager (yang/pkg)
pkgrewritten to v1.6.0 (see Shell & commands)yangnow just callspkg- New package index:
du,dns,irc,nginx,play,treeand more (mirror of 50+ packages)
Kernel / runtime services
- New kernel request
netshto list opened objects - New syscall
niceto change process priority - New log manager
sys/smile/logs.lua(install withyang install log) os.exit()/process-death is now silent (no morejava.lang.Errorprinted); real Lua/resource errors are still reported- Lua cached tokens limited to 100 files
- Config. file
OpenRMSno longer appears in file listings - Fixed
id— couldn't retrieve the id from root and other system virtual users
Bug fixes
IMPLICT→IMPLICITin theListconstructorinituses the bare command name soexecresolves/bin/correctlysocket.http.rgetwas sending POST instead of GET (405 on package downloads) — now GET>redirection no longer dropped arguments before the operatorrmon VFS subdirectories (correct exit 0,-r)- silent
os.mkdir/os.exit; cast fix indeleteFile; OOM handler with memory usage pkg/fetch_filewith the/apps/URL prefix_Gas the default global instead of_ENV
Build / toolchain
build-elf.sh(new) — assembles.s/.cinto ARM ELF32 for the emulator (options-o,-T,-lib,-entry,-keep; Python validation)- New test ELFs:
netsock,netudp,whoami,catinres/apps/dist/ res/lib/lib32.sexpanded (+602 lines); new sourcesnetsock.s,netudp.s,server.s,whoami.s- Removed the
j2me-lib/tree (Android stubs)
Deployment / infrastructure
Dockerfile(new): PHP 8.3 FPM Alpine + nginx + supervisord; services php-fpm, nginx, Python mirror (:31522), pproxy (:4096+ Flask web:10141)docker/:nginx.conf,php.ini,supervisord.conf;pproxysubmodule in.gitmoduleskrnl/: desktop Python kernel reimplementing the runtime (kernel.py,main.py,tkgui.py,lua/)index.phpexpanded
Documentation / config
AGENTS.md; newCODE_OF_CONDUCT.md,CONTRIBUTING.md,SECURITY.mddocs/BUILD.md,docs/FILESYS.md,docs/USERS.md,docs/lua/README.mdexpanded; 5 new examples indocs/lua/examples/- Proxy/HOME_URL:
opentty.xyz→opentty.fun;RELEASEchanged from"stable"to"mod" - New
res/template.ini
Lua runtime
- New global function
assert(v [, msg]): raises an error withmsg(default"assertion failed!") whenvis falsy (false/nil); returns all arguments unchanged when truthy #argno longer countsarg[0](the script name) — it now returns just the positional argument count;arg[1]remains the first argument- Fixed missing
breakfall-through bugs in the function dispatcher:os.setlocaleno longer falls intoos.exit(previously killed/destroyed the caller)io.setstdoutno longer falls intoio.mount(previously could wipe the VFS table)io.closeno longer falls intoio.open(previously returned a bogus stream)os.getprocwith an unknown PID no longer falls intoos.setproc(now returns "process not found")os.exitnow has an explicitbreakinstead of falling intoos.date
io.popennow setsUSERin the child scope to match the owner uid — so running a child withsudo=false(uid 1000) reflects the correct username; the ELF path also clones the scope instead of sharing the parent's
Process management
/bin/initnow spawnsxtermasjava.midlet.username(uid 1000) viaio.popen("/bin/xterm", "", false)without dropping init's own root privileges (theos.sucall was removed)
Storage / persistence
OpenTTY.loadRMSnow closes theRecordStorein afinallyblock before returning — no more leaked record-store handles on every VFS read
ELF emulator
heapStartfixed from0x200000(2MB, outside the 1MB RAM) to0x40000(256KB) —brk()/mmap()/mallocnow actually allocate instead of returning-ENOMEMcleanup()on process exit now flushesByteArrayOutputStreamfile descriptors to disk — ELF output is no longer silently lost when the program exits without an explicitclose()
Commands / apps
src/bin(rm,mkdir,touch,kill,pkg) andapps/(useradd,userdel,stop,du,open,sudo) updated for the new#argsemantics — the previous#arg - 1idiom skipped the last argumentsudonow builds and executes the full command (arg[1] .. arg[N]), no longer dropping extra argumentsapps/net/proxy.luanow breaks the read loop when the server disconnects (cmd == ""), fixing an infinite busy-spin