diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 09:03:41 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 78d6f64e72be2a22c40feaf012636bc8f04d46de (patch) | |
| tree | ae2f5828eb32f78e1536a75235706828067e6e0b /test | |
| parent | 039ae6aa70d963f942d8a5747060c67599664af9 (diff) | |
| download | pardes-78d6f64e72be2a22c40feaf012636bc8f04d46de.tar.gz pardes-78d6f64e72be2a22c40feaf012636bc8f04d46de.zip | |
A shell given a directory is not taken to be in this process's before it has spoken, so it logs no rename to the session's and back
Each host read /proc/<pid>/cwd right after forking the shell and at every
frame after; before the shell's chdir that says this process's directory,
a rename to it, then the real one a frame later, a rename back. A shell
given a directory is named by it already (newShell) and is no longer
asked at fork; and until it has printed anything, an answer naming this
process's directory is not taken.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/fs.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -494,6 +494,26 @@ def unattended_messages_expire(binary): assert not shown(), 'an unattended message outlived MessageLinger' +def new_terminals_named_once(binary): + """A terminal started outside the session's directory is named by that + directory from its `new` on: no rename to the session's and back.""" + with tempfile.TemporaryDirectory(prefix='pardes-names-') as directory: + root = Path(directory) + (root / 'sub').mkdir() + with session(binary, root, 'names') as (client, _): + made = [look(client, str(root / 'sub'))] + before = {int(row.split()[0]) for row in client.read('/index').splitlines()} + client.write('/pane/1/ctl', b'Tty\n') + if shutil.which('fish'): + client.write('/pane/1/ctl', b'Tty fish\n') + made += [s for s in (int(row.split()[0]) for row in client.read('/index').splitlines()) if s not in before] + time.sleep(1.5) # their shells start and say where they are + log = client.read('/log').decode() + for serial in made: + assert f'\nrename {serial} ' not in '\n' + log, (serial, log) + assert f'\nnew {serial} {root}' in '\n' + log, (serial, log) + + def python_repl_runs_one_line(binary): """A one-line exec sent to Python's own REPL (3.13's pyrepl, which asks for bracketed paste) runs at once, with no second Enter: the Enter @@ -610,6 +630,7 @@ def test(binary, quic=False): run_file(binary) exit_answers(binary) unattended_messages_expire(binary) + new_terminals_named_once(binary) python_repl_runs_one_line(binary) signal_cleans_up(binary) for options, message in [ |
