diff options
Diffstat (limited to 'docs')
| -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. |
