mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Connection.close() ends stdin and sends SIGTERM at once. The daemon did not handle SIGTERM, so it died before its end-of-input kill_all, and running commands were reparented to init. The daemon now blocks SIGTERM, SIGINT and SIGHUP before starting any thread and waits for them on its own thread, which kills every process group it started and exits. On Windows the job object already kills commands with the daemon.
3.2 KiB
3.2 KiB
Changelog
[Unreleased]
Breaking Changes
RemoteWatcherfollows Durable'sFileWatcher:close(context)isstop(context), and its changes are tagged ({ kind: "paths", paths },{ kind: "overflow" },{ kind: "failed", error }). The daemon'swatchprotocol is unchanged. Migration:await watcher.close(ctx)becomesawait watcher.stop(ctx); testchange.kindinstead of"overflow" in changeor"error" in change.
Fixed
execandptyfail withspawn_errorinstead of hanging when the daemon cannot start a helper thread (for example at a cgroup task limit); the started command is killed and reaped (#11433).Connection.close()on Unix no longer leaves running commands behind: the daemon used to die from the client'sSIGTERMbefore killing its process groups. It now kills them onSIGTERM,SIGINTorSIGHUPbefore exiting.
[1.4.0] - 2026-10-21
[1.3.0] - 2026-10-15
[1.2.0] - 2026-10-12
Added
- The daemon's
listFilesoperation: a bounded, cancellable, gitignore-aware listing of a directory tree (files, directories and unfollowed symlinks);helloreports it infeatures, and older daemons answernot_supportedwithout a request. RemoteExecutionEnv.listFilesandLocalExecutionEnv, a localExecutionEnvon a pi-env daemon connection with the same operations.nodePlatform(info)maps the daemon's platform and architecture names to Node's.- Pseudo-terminals for interactive programs: the daemon's
pty,ptyWrite, andptyResizeoperations stream raw terminal output as events, write input in arrival order, sendSIGWINCHon resize, and kill the process group on cancel or a lost connection.openTerminal()returns aRemoteTerminal, andlocalDaemon()starts the daemon for this machine. Unix only; Windows answersENOTSUP. RemoteTerminal.foreground()(daemonptyForeground) reports the process group in front of a terminal when it is not the program's own, such as a job its shell runs, with the leader's name on macOS and Linux (TerminalForeground).
[1.1.0] - 2026-10-07
[1.0.4] - 2026-10-05
Added
- Initial release of
@earendil-works/pi-env:RemoteExecutionEnv, a DurableExecutionEnvon another machine, andConnectionto thepi-envdaemon that runs there. Results matchNodeExecutionEnvon that machine on Linux, macOS, Android and Windows. The daemon watches files natively (polling on Windows and network file systems), honors output windows so dropped command output is not transferred, and keeps control replies ahead of bulk output; watchers reportoverflowand resume after a lost connection. - SSH bootstrap:
connectSshdetects the remote system, deploys the daemon this package ships for it (named by its SHA-256 and verified before every start), and connects;sshConnectiondoes the same lazily at the first operation, so building an environment never needs the network without forwarding, shared connections or configured commands;loginShellstarts it through the user's login shell, and Termux hosts get setup warnings.scanHostKey,acceptHostKeyandforgetHostKeymanage trusted host keys; a changed key is never accepted without removing the old one.