···11# Changelog
2233+## Unreleased
44+55+### Fixes
66+- Validate session `cwd` before spawning and surface explicit errors (`Working directory does not exist`, `Working directory is not a directory`, `Working directory is not searchable`) instead of failing silently with exit code 1 or misleading `posix_spawnp failed` messages (#9, #10, thanks @schickling)
77+- Lazy-load the interactive TUI module so non-interactive CLI commands like `pty list` don't crash with `uv_cwd` when launched from a deleted directory (#9, #10)
88+- Clarify the `posix_spawnp` error message to mention the actual PTY shell and cwd context instead of blaming the wrapped command
99+310## 0.5.0
411512### Client API (`@myobie/pty/client`)
+6-4
src/cli.ts
···1919import { spawnDaemon, resolveCommand } from "./spawn.ts";
2020import { EventFollower, readRecentEvents, formatEvent } from "./events.ts";
21212222-const runInteractive = async (): Promise<void> => {
2323- const { runInteractive } = await import("./tui/interactive.ts");
2424- await runInteractive();
2525-};
2222+// Lazy-load the interactive TUI so non-interactive commands don't crash when
2323+// the caller's cwd was deleted (the TUI module evaluates process.cwd() at load).
2424+async function runInteractive(): Promise<void> {
2525+ const mod = await import("./tui/interactive.ts");
2626+ await mod.runInteractive();
2727+}
26282729function usage(): void {
2830 console.log(`Usage:
+2
src/server.ts
···7474 }
7575}
76767777+/** Validate that cwd is usable for spawning a process. Returns undefined if
7878+ * valid, or a descriptive error string explaining what's wrong. */
7779function describeInvalidCwd(cwd: string): string | undefined {
7880 if (cwd.length === 0) return "Working directory is empty.";
7981