diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-27 19:54:35 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | c1be5b6b7c11f5dc17fd221c8d01b5693d0ffd0b (patch) | |
| tree | dec7ed0e5ab697be1e5b56dd1fbb6bab5d5ffb83 /docs/open-questions.md | |
| parent | 7f31e62b63a64cef3916aac21417b7b1414000aa (diff) | |
| download | pardes-c1be5b6b7c11f5dc17fd221c8d01b5693d0ffd0b.tar.gz pardes-c1be5b6b7c11f5dc17fd221c8d01b5693d0ffd0b.zip | |
docs: record the open question of where an unknown command word runs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs/open-questions.md')
| -rw-r--r-- | docs/open-questions.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/open-questions.md b/docs/open-questions.md new file mode 100644 index 00000000..e48d715e --- /dev/null +++ b/docs/open-questions.md @@ -0,0 +1,39 @@ +# Open questions + +Decisions deliberately left open, with what is known so far, so they can be +picked up without redoing the research. + +## Where does an unknown command word run? + +Raised 2026-09-27 in the review of pardes against acme (Plan 9 source at +`~/05-genizah/principia-softwarica`). Undecided. + +**Today.** A middle-click, an `exec` write or a tag word that is not a builtin +is typed into a terminal pane: the pane itself when it takes a command line, +else a shell for the pane's directory (`Pardes.execute`, `ttyForDir` in +`src/pardes.zig`). The command shares that shell's cwd, environment, history +and aliases, and its output lands in the terminal. + +**acme.** An external command runs as its own process: stdin from +`/dev/null`, stdout and stderr to the directory's `+Errors` window, `$winid` +and `%` set for it (`editors/acme/exec.c`, `run()` and its callers around +:1180-1300 and :1425). No shell state is shared between commands. + +**What each costs.** + +* Typing into a shell: interactive programs work, and so do aliases and + functions. But every command depends on that shell's state (is it busy, + which directory it is in, what was typed at its prompt), and a misspelled + builtin silently becomes a shell command. The 9P `exec` file cannot report + that the command failed. +* A process per command: the misspelling hazard goes away at the root, the + editor knows each command's exit status and output, and `exec` could answer + the way `pty/run` does. But aliases, shell functions and interactive + programs need a terminal of their own, and output goes to a `+Errors`-style + buffer rather than a live terminal. + +**Related.** `pty/run` (see `docs/fs.md`) already gives an agent the second +behaviour inside a chosen terminal: a line in, `exit N` and its output out. +The planned root `ctl` (session builtins) and pane `ctl` (pane builtins) +refuse unknown words, whatever is decided here; the question is only what +`exec` and the middle-click do with them. |
