Push261104 — 终端(PTY)与 v1 输入修复
两个功能性修复,都是「表面全绿、实际不能用」的那类问题。
v2 native — 2.2.5-2
问题:POST /api/pty 一直 500 ERR_DLOPEN_FAILED。TUI、serve、Web UI 全部正常,但只要开终端(TUI 里开 pane、远程客户端连 PTY、/goal 这类需要终端的操作)就失败——因为内嵌的 librust_pty 是 glibc 构建,bionic 没有 libpthread.so.0。
修复:不再用 musl + shim 那条路(试过:能 dlopen,但 Bun 在 POST /api/pty 时 SIGSEGV@0x0,musl 的运行时预期远超 shim 能覆盖的几个符号)。改为直接为本机编译:本机 rustc 的 host 就是 aarch64-linux-android,把 bun-pty 的 Rust crate 编成 bionic 件(540 KB,只需补 termios 0.2.2 的 android cfg 与静态链接 libunwind.a)。
验证(oscar / Android 9 / kernel 3.18.140):pty=ok,POST /api/pty 返回真实 zsh 进程;serve/TUI/键入/15s 全部照旧通过。
v1 native — 1.19.4-2
问题:TUI 只显示不能操作——进去就吐 ^[]10;rgb:…、^[[?1016;0$y、^[P0+r4d73^[\,点击回 0;108;22M。
根因:不是解析器。启动器为了捕获 SIGSEGV 崩溃 stderr,把 TUI 放在后台进程组("$OC_RT" ... & + wait),于是它拿不到终端前台权,raw 模式设不上(stty 实测 isig icanon echo 全开)——按键要回车才送达,终端对启动探测的应答被 tty 回显成垃圾,鼠标上报变文本。
修复:启动器改前台运行(崩溃记录与退出码不变);另加一条等长的二进制守卫,把 opentui 的 CPR 守卫泛化成「出现第二个 ESC 就丢弃」,防 Termux 把探测应答粘成一坨。
验证:raw=-icanon、键入无需回车直接进输入框、首屏无 rgb:/$y 垃圾。
Assets
本批先发这两个已真机验证的 native 修复(deb + pacman)。wrapper 家族的补齐(2.1.x/2.2.x 与 1.19.5)会在后续批次补上。
English: two functional fixes — native 2.2.5-2 restores terminal/PTY creation on bionic (the embedded librust_pty is now built natively for aarch64-linux-android instead of shipping the glibc asset), and native 1.19.4-2 fixes the v1 TUI being display-only (the launcher ran the TUI in a background process group, so it could never take the tty out of canonical/echo mode).