diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 14:20:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | e7c181d6238dae4b08a02c1a9828917c2497f89d (patch) | |
| tree | 299d4146c53ca5f882ba37cceb67a37302be2437 /test | |
| parent | eb2428115588004a8bc04a09d45fb1104f727882 (diff) | |
| download | pardes-e7c181d6238dae4b08a02c1a9828917c2497f89d.tar.gz pardes-e7c181d6238dae4b08a02c1a9828917c2497f89d.zip | |
A command line runs as its own command pane unless it is clicked at a shell's prompt
A middle click, an exec write or a tag word that no builtin knows was typed
into some terminal for the pane's directory, sharing whatever state that
shell was in and answering nothing, so a misspelling vanished into a shell.
Now only a line clicked at an interactive terminal's prompt is typed there.
From anywhere else it runs as a command pane: a terminal whose child is
$SHELL -c the line in the pane's directory, full emulation, which shows its
output and then exit N from the host's reaping of the child, and stays. A
finished command pane is the next command's for its directory, which runs
below what it showed after a '% line' line (acme appends to +Errors and never
clears it, util.c:213); a running one gets a second pane. Kill ends a command
pane's whole process group, the log records run and exit, exec reads back the
command pane's serial, and a line is at most 1 KB, read off the pane as the
host forks rather than carried in every spawn effect. ttyForDir's search for
a free shell is gone. The goldens of chordcut, cmdword and layout-open change
where a file's exec now opens a command pane, and ttytaken is rewritten to
exec from the terminal itself; docs/open-questions.md records the decision.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/snapshots/chordcut.golden | 14 | ||||
| -rw-r--r-- | test/snapshots/cmdword.golden | 31 | ||||
| -rw-r--r-- | test/snapshots/cmdword.snap | 22 | ||||
| -rw-r--r-- | test/snapshots/layout-open.golden | 6 | ||||
| -rw-r--r-- | test/snapshots/layout-open.snap | 8 | ||||
| -rw-r--r-- | test/snapshots/ttytaken.golden | 91 | ||||
| -rw-r--r-- | test/snapshots/ttytaken.snap | 59 |
7 files changed, 122 insertions, 109 deletions
diff --git a/test/snapshots/chordcut.golden b/test/snapshots/chordcut.golden index b814d888..42725e42 100644 --- a/test/snapshots/chordcut.golden +++ b/test/snapshots/chordcut.golden @@ -30,11 +30,11 @@ == snap cancelexec grid=120x31 cursor=25,8 |8: 2 2echo B''OO g.txt == snap execafter grid=120x31 cursor=25,8 -|3: f.txt ls -|4: BOO f.txt g.txt -|7: 1 line 1 Exec +|6: /tmp/pardes-snap/chordcut/cwd/f.txt * Save Tty Collapse D /tmp/pardes-snap/chordcut/cwd (echo B''OO) exit 0 Kill Sa +|7: 1 line 1 Exec BOO +|8: 2 2echo B''OO g.txt exit 0 == snap cancellook grid=120x31 cursor=25,8 -|7: 1 line 1 +|7: 1 line 1 BOO == snap lookafter grid=120x31 cursor=7,13 |12: /tmp/pardes-snap/chordcut/cwd/g.txt Save Tty Collapse Del |13: 1 line 1 @@ -44,10 +44,10 @@ |0: 0-70 #b2c3b8,#1d2824, 71-119 d,#1d2824, |1: 0-1 #ffffff,#887455, 2-2 d,#26362d, 3-34 #becfc4,#26362d, 35-59 d,#26362d, 60-61 #ffffff,#887455, 62-62 d,#1d2824, 63-94 #b2c3b8,#1d2824, 95-119 d,#1d2824, |2: 0-1 #ffffff,#496656, 2-2 d,#1d2824, 3-32 #b2c3b8,#1d2824, 33-35 #d3b0d9,#1d2824, 36-59 #b2c3b8,#1d2824, 60-61 #ffffff,#496656, 62-62 d,#1d2824, 63-92 #b2c3b8,#1d2824, 93-95 #d3b0d9,#1d2824, 96-119 #b2c3b8,#1d2824, -|3: 0-0 d,#152019, 1-1 d,#0d1410, 2-8 #e5eee5,#0d1410, 9-59 d,#0d1410, 60-60 d,#608269, 61-61 d,#0d1410, 62-119 #e5eee5,#0d1410, +|3: 0-0 d,#608269, 1-1 d,#0d1410, 2-59 #e5eee5,#0d1410, 60-60 d,#608269, 61-61 d,#0d1410, 62-119 #e5eee5,#0d1410, |4: 0-0 d,#608269, 1-1 d,#0d1410, 2-59 #e5eee5,#0d1410, 60-60 d,#608269, 61-61 d,#0d1410, 62-119 #e5eee5,#0d1410, -|5: 0-0 d,#152019, 1-59 d,#0d1410, 60-60 d,#608269, 61-119 d,#0d1410, -|6: 0-1 #ffffff,#496656, 2-2 d,#1d2824, 3-32 #b2c3b8,#1d2824, 33-37 #d3b0d9,#1d2824, 38-59 #b2c3b8,#1d2824, 60-60 d,#608269, 61-61 d,#0d1410, 62-119 #e5eee5,#0d1410, +|5: 0-0 d,#608269, 1-59 d,#0d1410, 60-60 d,#608269, 61-119 d,#0d1410, +|6: 0-1 #ffffff,#496656, 2-2 d,#1d2824, 3-32 #b2c3b8,#1d2824, 33-37 #d3b0d9,#1d2824, 38-59 #b2c3b8,#1d2824, 60-61 #ffffff,#496656, 62-62 d,#1d2824, 63-119 #b2c3b8,#1d2824, |7: 0-0 d,#608269, 1-1 d,#0d1410, 2-6 #59675c,#0d1410, 7-12 #e5eee5,#0d1410, 13-59 d,#0d1410, 60-60 d,#608269, 61-61 d,#0d1410, 62-119 #e5eee5,#0d1410, |8: 0-0 d,#608269, 1-1 d,#0d1410, 2-6 #59675c,#0d1410, 7-24 #e5eee5,#0d1410, 25-59 d,#0d1410, 60-60 d,#608269, 61-61 d,#0d1410, 62-119 #e5eee5,#0d1410, |9: 0-0 d,#608269, 1-1 d,#0d1410, 2-6 #59675c,#0d1410, 7-12 #e5eee5,#0d1410, 13-59 d,#0d1410, 60-60 d,#608269, 61-61 d,#0d1410, 62-119 #e5eee5,#0d1410, diff --git a/test/snapshots/cmdword.golden b/test/snapshots/cmdword.golden index 99ad446b..0b6d91aa 100644 --- a/test/snapshots/cmdword.golden +++ b/test/snapshots/cmdword.golden @@ -4,21 +4,24 @@ | /tmp/pardes-snap/cmdword/cwd/cmds.txt Save Tty Collapse Del | 1 @`echo ZZ''E` @`echo ZZ''L` Look p.txt @`Look .` == snap atexec grid=120x31 cursor=7,3 -|17: /tmp/pardes-snap/cmdword/cwd Tty Save Mode Filter Collapse Del -|18: echo ZZ''E -|19: ZZE -== snap atlook grid=120x31 cursor=4,22 -|20: echo ZZ''L +|17: /tmp/pardes-snap/cmdword/cwd (echo ZZ''E) exit 0 Kill Save Collapse Del +|18: ZZE +|19: exit 0 +== snap atlook grid=120x31 cursor=2,23 +|17: /tmp/pardes-snap/cmdword/cwd (echo ZZ''L) exit 0 Kill Save Collapse Del +|20: % echo ZZ''L |21: ZZL +|22: exit 0 == snap lookword grid=120x31 cursor=7,11 |10: /tmp/pardes-snap/cmdword/cwd/p.txt Save Tty Collapse Del |11: 1 just text -== snap nested grid=120x31 cursor=4,24 -|22: ls -|23: cmds.txt p.txt zzmark.txt -== snap execword grid=120x31 cursor=4,24 -|17: /tmp/pardes-snap/cmdword/cwd Tty Save Mode Filter Collapse Del Exec -== snap tagcmd grid=120x31 cursor=4,24 -|17: /tmp/pardes-snap/cmdword/cwd Tty Save Mode Filter Collapse Del Exec @`echo ZZ''T` -|24: echo ZZ''T -|25: ZZT +== snap nested grid=120x31 cursor=4,9 +|6: /tmp/pardes-snap/cmdword/cwd Tty Save Mode Filter Collapse Del +|7: ls +|8: cmds.txt p.txt zzmark.txt +== snap execword grid=120x31 cursor=4,9 +|6: /tmp/pardes-snap/cmdword/cwd Tty Save Mode Filter Collapse Del Exec +== snap tagcmd grid=120x31 cursor=4,7 +|6: /tmp/pardes-snap/cmdword/cwd Tty Save Mode Filter Collapse Del Exec @`echo ZZ''T` +|7: echo ZZ''T +|8: ZZT diff --git a/test/snapshots/cmdword.snap b/test/snapshots/cmdword.snap index 361e37ba..631fab8b 100644 --- a/test/snapshots/cmdword.snap +++ b/test/snapshots/cmdword.snap @@ -7,9 +7,10 @@ # whole run instead, which is what makes a single CLICK the way you invoke one # (acme does the same for its own `<`/`|`/`>` command words). # -# EXECUTE runs it and leaves you where you were; LOOK runs it and lands you in -# the shell that answered — looking at a thing means being shown it, and a -# directory's look has always been exactly that (a shell there, ls'd). +# EXECUTE runs it, as a command pane, and leaves you where you were; LOOK runs +# it and lands you in the pane that answered — looking at a thing means being +# shown it, and a directory's look has always been exactly that (a shell +# there, ls'd). # # And Look and Exec are ORDINARY BUILTINS now, so their names are executable # words like Save or Grep: `Look p.txt` run off the page is the same look a @@ -28,14 +29,15 @@ wait 8000 cmds.txt stable 700 20000 snap opened # a single middle CLICK inside the run (col 11 is inside `echo`) expands to the -# whole `@`echo ZZ''E`` and executes it in a shell; focus stays on the file +# whole `@`echo ZZ''E`` and runs it as a command pane; focus stays on the file press middle 11 4 release middle 11 4 wait 10000 ZZE stable 700 15000 snap atexec -# LOOK on the second one (col 24, inside its `echo`) runs it too AND focuses -# the shell that answered — that is the whole difference between the two verbs +# LOOK on the second one (col 24, inside its `echo`) runs it too, in the same +# command pane now its first is done, below it, AND focuses it — that is the +# whole difference between the two verbs press right 24 4 release right 24 4 wait 10000 ZZL @@ -49,16 +51,16 @@ wait 10000 just text stable 700 15000 snap lookword # nesting: `@`Look .`` — Exec unwraps it, `Look .` is parsed as the ordinary -# Look builtin with an argument, and Look opens the directory (an existing -# shell there, ls'd — zzmark.txt is only ever in that listing) +# Look builtin with an argument, and Look opens the directory (a shell there, +# ls'd — zzmark.txt is only ever in that listing; a command pane is no shell) press middle 49 4 release middle 49 4 wait 10000 zzmark.txt stable 700 15000 snap nested # the same syntax typed into a TAG — the other place the expansion has to know -# about backticks. The look above left the shell focused, so `:` opens ITS -# tag; `A` appends at the end of it, Esc and `h` put the normal-mode cursor on +# about backticks. The look above left that shell focused, so `:` opens ITS +# tag, and the word run from a shell's own tag is typed into it; `A` appends at the end of it, Esc and `h` put the normal-mode cursor on # the last character typed, and the execute key runs the word under it # exactly as the body's does. key : diff --git a/test/snapshots/layout-open.golden b/test/snapshots/layout-open.golden index f682924a..2bfdde63 100644 --- a/test/snapshots/layout-open.golden +++ b/test/snapshots/layout-open.golden @@ -31,6 +31,6 @@ |21: /tmp/pardes-snap/layout-open/cwd/sub/f.txt Save |22: 1 echo 'TTY'OK == snap ttydir grid=100x31 cursor=7,22 -|10: /tmp/pardes-snap/layout-open/cwd/sub Tty Save M -|11: echo 'TTY'OK -|12: TTYOK +|10: /tmp/pardes-snap/layout-open/cwd/sub (echo 'TTY +|11: TTYOK +|12: exit 0 diff --git a/test/snapshots/layout-open.snap b/test/snapshots/layout-open.snap index d7d7e19e..04770f27 100644 --- a/test/snapshots/layout-open.snap +++ b/test/snapshots/layout-open.snap @@ -1,5 +1,5 @@ # every pane open splits ONE existing pane, the rest of the column keeps its -# sizes: Alt-n splits the active pane, an execute-spawned shell for a file's +# sizes: Alt-n splits the active pane, an execute-spawned command pane for a file's # dir splits only the bottom pane of the rightmost column. At this narrow # width the first looked-up file also splits below its source, leaving every # unrelated pane (including the ones above the source) at its exact rectangle. @@ -44,9 +44,9 @@ press right 7 28 release right 7 28 stable 700 15000 snap file-open -# execute the file's command (middle drag over line 1): no shell has cwd sub/, -# so one is forked at the bottom of the rightmost column, splitting only the -# pane above it +# execute the file's command (middle drag over line 1): it runs as a command +# pane for sub/, forked at the bottom of the rightmost column, splitting only +# the pane above it press middle 8 23 drag middle 19 23 release middle 19 23 diff --git a/test/snapshots/ttytaken.golden b/test/snapshots/ttytaken.golden index 72708e64..3fb29738 100644 --- a/test/snapshots/ttytaken.golden +++ b/test/snapshots/ttytaken.golden @@ -1,47 +1,48 @@ -== snap opened grid=210x31 cursor=7,3 +== snap opened grid=210x31 cursor=4,5 |Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Exit -| New Tty Find Grep Joincol Delcol New Tty Find Grep Joincol Delcol -| /tmp/pardes-snap/ttytaken/cwd/cmd.txt Save Tty Collapse Del /tmp/pardes-snap/ttytaken/cwd Tty Save Mode Filter Collapse Del -| 1 echo TAKEN''ONE ls -| 2 echo TAKEN''TWO big.txt cmd.txt -== snap at-prompt grid=210x31 cursor=7,3 -|3: 1 echo TAKEN''ONE Exec ls -|5: echo TAKEN''ONE -|6: TAKENONE -== snap paging grid=210x31 cursor=114,30 -|2: /tmp/pardes-snap/ttytaken/cwd/cmd.txt Save Tty Collapse Del $ /tmp/pardes-snap/ttytaken/cwd Tty Save Mode Filter Collapse Del -|3: 1 echo TAKEN''ONE line 1 -|4: 2 echo TAKEN''TWO line 2 -|5: line 3 -|6: line 4 -|7: line 5 -|8: line 6 -|9: line 7 -|10: line 8 -|11: line 9 -|12: line 10 -|13: line 11 -|14: line 12 -|15: line 13 -|16: line 14 -|17: line 15 -|18: line 16 -|19: line 17 -|20: line 18 -|21: line 19 -|22: line 20 -|23: line 21 -|24: line 22 -|25: line 23 -|26: line 24 -|27: line 25 -|28: line 26 -|29: line 27 -|30: big.txt -== snap spawned grid=210x31 cursor=108,26 -|3: 1 echo TAKEN''ONE Exec line 1 -|26: : -|27: /tmp/pardes-snap/ttytaken/cwd Tty Save Mode Filter Collapse Del -|28: echo TAKEN''TWO -|29: TAKENTWO +| New Tty Find Grep Joincol Delcol +| /tmp/pardes-snap/ttytaken/cwd Tty Save Mode Filter Collapse Del +| ls +| big.txt +== snap at-prompt grid=210x31 cursor=4,5 +|2: /tmp/pardes-snap/ttytaken/cwd Tty Save Mode Filter Collapse Del @`echo TAKEN''ONE` +|3: ls Exec +|5: echo TAKEN''ONE +|6: TAKENONE +== snap paging grid=210x31 cursor=9,30 +|3: line 1 +|4: line 2 +|5: line 3 +|6: line 4 +|7: line 5 +|8: line 6 +|9: line 7 +|10: line 8 +|11: line 9 +|12: line 10 +|13: line 11 +|14: line 12 +|15: line 13 +|16: line 14 +|17: line 15 +|18: line 16 +|19: line 17 +|20: line 18 +|21: line 19 +|22: line 20 +|23: line 21 +|24: line 22 +|25: line 23 +|26: line 24 +|27: line 25 +|28: line 26 +|29: line 27 +|30: big.txt +== snap spawned grid=210x31 cursor=104,2 +|2: /tmp/pardes-snap/ttytaken/cwd Tty Save Mode Filter Collapse Del @`echo TAKEN''ONE` @`echo TAKEN''TWO` +|3: line 1 Exec +|26: : +|27: /tmp/pardes-snap/ttytaken/cwd (echo TAKEN''TWO) exit 0 Kill Save Collapse Del +|28: TAKENTWO +|29: exit 0 |30: diff --git a/test/snapshots/ttytaken.snap b/test/snapshots/ttytaken.snap index 47554876..a6ccb632 100644 --- a/test/snapshots/ttytaken.snap +++ b/test/snapshots/ttytaken.snap @@ -1,43 +1,50 @@ -# Process monitoring, end to end. A pane whose tty is held by a full-screen -# program is not somewhere a command line may be typed: the SAME middle-drag -# Exec goes into the shell while it sits at its prompt, and into a NEW shell -# beside it once `less` owns the terminal — where it runs, instead of becoming -# keystrokes the pager would eat. Nothing about the pager's screen changes. -file cmd.txt echo TAKEN''ONE\necho TAKEN''TWO +# Process monitoring, end to end. A terminal whose tty is held by a +# full-screen program is not somewhere a command line may be typed: the SAME +# Exec from that terminal goes into its shell while it sits at its prompt, +# and into a command pane of its own once `less` owns the terminal -- where +# it runs, instead of becoming keystrokes the pager would eat. Nothing about +# the pager's screen changes. (From any pane but a terminal, an Exec always +# runs as a command pane: exec.snap and cmdword.snap.) lines big.txt 40 start 31 210 -n 1 -wait 8000 cmd.txt -stable 700 20000 -# open the command file by looking its name in the greeting `ls` -press right 14 5 -release right 14 5 -wait 10000 echo TAKEN +wait 8000 big.txt stable 700 20000 snap opened -# at the prompt: the drag runs in the shell that is already on this directory -press middle 8 4 -drag middle 22 4 -release middle 22 4 +# at the prompt: a command word in the terminal's own tag, executed, is +# typed into its shell. `:` opens the tag, `A` appends, and the execute key +# runs the word under the cursor. +key : +key A +key space +text @`echo TAKEN''ONE` +key esc +settle 100 +key h +key tab wait 10000 TAKENONE stable 700 20000 snap at-prompt -# ...and now a pager owns that terminal. Ctrl-b is raw tty (config.tty_toggle), -# which is how a script types AT the shell instead of into the pane's own edit -# buffer — the same way exec.snap runs a command line. -press left 150 9 -release left 150 9 -stable 400 5000 +# ...and now a pager owns that terminal. Ctrl-b is raw tty +# (config.tty_toggle), which is how a script types AT the shell instead of +# into the pane's own edit buffer. key c-b stable 400 5000 text env LESS= less big.txt key enter wait 10000 line 1 stable 700 20000 +key c-b +stable 400 5000 snap paging -# the same gesture on the second line: a new shell, not `less` keystrokes -press middle 8 5 -drag middle 22 5 -release middle 22 5 +# the same gesture from that terminal: a command pane, not `less` keystrokes +key : +key A +key space +text @`echo TAKEN''TWO` +key esc +settle 100 +key h +key tab wait 10000 TAKENTWO stable 700 20000 snap spawned |
