From 7c6165f184e45af30ac697f8e8a584529ac4a287 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 3 Sep 2026 13:11:24 -0300 Subject: boot: argv naming nothing opens an errors pane, not a stack trace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `pardes nosuchfile` returned error.BadArgs out of nativeMain, which std prints as `error: BadArgs` with a return trace under it — indistinguishable from a crash, for a typo, and it left the human with no editor at all. A launch that names something look.resolve cannot make a target of now boots one +Errors pane filling the window, saying `file or directory not found` and the argument AS TYPED: acme's own vocabulary for output that came from the program rather than from a word somebody clicked, and the word rather than a resolved path because `pardes ~/notes/tdoo.md` wants to see its own typo back. A chdir that fails on a directory that really is one stays BadArgs. That is a permission problem rather than a typo, and the two want different answers. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016Q4RATpafkwahrovHQLKRf --- src/main.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 41495a48..60491052 100644 --- a/src/main.zig +++ b/src/main.zig @@ -333,6 +333,14 @@ fn nativeMain(init: std.process.Init) !void { opts.file_line = t.at.line; }, .image => |t| opts.file = try arena.dupe(u8, t.path), + // Nothing of that name is there. A typo is not a reason to + // refuse to start: the session boots with one `+Errors` pane + // naming what was asked for (pardes.zig `missing_path`). The + // other arms stay `BadArgs` — a `.dir` here means `chdir` + // refused a directory that IS one, which is a permission + // problem and not a typo, and `.url`/`.pane` are targets no + // launch can act on. + .none => opts.missing_path = try arena.dupe(u8, a), else => return error.BadArgs, } } -- cgit v1.3