From 0a15af8d98771180e32402e68ea844f9f377cefb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 9 Aug 2026 02:34:49 -0300 Subject: a pardes launched inside pardes hands its file to the outer one --- test/snapshots/nested.golden | 93 ++++++++++++++++++++++++++++++++++++++++++++ test/snapshots/nested.snap | 48 +++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 test/snapshots/nested.golden create mode 100644 test/snapshots/nested.snap (limited to 'test') diff --git a/test/snapshots/nested.golden b/test/snapshots/nested.golden new file mode 100644 index 00000000..7b9ee1b5 --- /dev/null +++ b/test/snapshots/nested.golden @@ -0,0 +1,93 @@ +== snap file-arg grid=100x30 cursor=7,2 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +| /tmp/pardes-snap/nested/cwd/nested.txt Save New $ /tmp/pardes-snap/nested/cwd New Del +| 1 hello-from-nested $ $(readlink /proc/$PPID/exe) nested.txt +| 2 second-nested-line $ +| 3 +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap no-arg grid=100x30 cursor=4,6 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +|$ /tmp/pardes-snap/nested/cwd New Del +| $ $(readlink /proc/$PPID/exe) +| pardes: this shell is already inside pardes, and a pardes inside a pardes +| is spicy. Name a file or a directory and the outer session opens it, or +| pass --nested if you really want a second one in here. +| $ +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +== snap dir-arg grid=100x30 cursor=4,7 +|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill +|$ /tmp/pardes-snap/nested/cwd New Del +| $ $(readlink /proc/$PPID/exe) nestdir +| $ +| /tmp/pardes-snap/nested/cwd/nestdir New Del +| +| inside-nested.txt +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/test/snapshots/nested.snap b/test/snapshots/nested.snap new file mode 100644 index 00000000..0beeabf8 --- /dev/null +++ b/test/snapshots/nested.snap @@ -0,0 +1,48 @@ +# a pardes launched INSIDE a pardes hands its argument to the outer one. +# +# No harness support is needed to get a genuinely nested launch: a pane +# shell's parent IS the app under test, so `$(readlink /proc/$PPID/exe)` in a +# pane is this exact binary, and running it from there makes a real +# descendant — the same process tree a person typing `pardes foo.txt` in a +# pane produces. Each arm gets its own `start` so the Look never has to be +# aimed at a pane a previous arm moved. +# +# What discriminates is the GOLDEN GRID, not the `wait` below it: a nested +# pardes that opened its own UI in the pane would show the same file, so the +# content wait passes either way. The layout is what differs — an outer file +# pane beside the shell versus a whole second topbar inside it — and the +# `cursor=` on the first arm's header moves the moment that changes. +# +# Long waits on purpose: this forks and execs a whole second pardes. +dirmk nestdir +file nestdir/inside-nested.txt marker +file nested.txt hello-from-nested\nsecond-nested-line\n +# --- a FILE argument: a file pane appears in the OUTER instance --- +start 30 100 +wait 8000 $ +stable 700 20000 +text $(readlink /proc/$PPID/exe) nested.txt +key enter +# the CONTENT, not the border: the shell only ever echoed the file's NAME +# (see above for why the grid, not this line, is the real assertion) +wait 15000 hello-from-nested +stable 700 20000 +snap file-arg +# --- no argument: the spicy message, in the pane, and no second UI --- +start 30 100 +wait 8000 $ +stable 700 20000 +text $(readlink /proc/$PPID/exe) +key enter +wait 15000 already inside pardes +stable 700 20000 +snap no-arg +# --- a DIRECTORY argument: a shell there, greeted with ls --- +start 30 100 +wait 8000 $ +stable 700 20000 +text $(readlink /proc/$PPID/exe) nestdir +key enter +wait 15000 inside-nested.txt +stable 700 20000 +snap dir-arg -- cgit v1.3