diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 23:32:31 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:18 -0300 |
| commit | 48c129a701d60abdb836bbb400d949cc61ed2820 (patch) | |
| tree | 42f6ab7e64bc02c208a062eb31ad4937e4339f04 /test/fs.py | |
| parent | afaa2428b346f6dd1d165abe1396dce9150fa05c (diff) | |
| download | pardes-48c129a701d60abdb836bbb400d949cc61ed2820.tar.gz pardes-48c129a701d60abdb836bbb400d949cc61ed2820.zip | |
A command run from a pane gets acme's $winid, the serial of the pane it was run from; one from a column's or the workspace's tag gets none
PARDES_PANE names the command pane itself, so a script a click ran had
no way to address the pane it was run in, as acme's win scripts do with
$winid. The command pane now remembers that pane and its child gets
winid set to it; a header tag's command, which no pane owns, gets winid
unset. PARDES_PANE is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/fs.py')
| -rw-r--r-- | test/fs.py | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1306,6 +1306,24 @@ def test(binary, quic=False): # opened is deleted, as an $EDITOR must; one on a file already open # waits on that pane; a session that goes away ends it with 1. with session(binary, root, 'wait') as (client, address): + # A command run from a pane's tag gets acme's $winid, that pane; + # one from the workspace's tag, none. + def command_body(node, line): + client.write(node, line) + serial = int(client.read(node).split()[-1]) + deadline = time.monotonic() + 10 + while True: + log = client.read('/log').decode() + ran = log.rfind(f'\nrun {serial} ') + if ran >= 0 and f'\nexit {serial} ' in log[ran:]: + body = client.read(f'/pane/{serial}/body').decode().split('% echo winid')[-1] + client.remove(f'/pane/{serial}') + return body + assert time.monotonic() < deadline, log[-400:] + time.sleep(.05) + first_pane = min(int(row.split()[0]) for row in client.read('/index').splitlines()) + assert f'winid={first_pane}\n' in command_body(f'/pane/{first_pane}/tagexec', b'echo winid=$winid\n') + assert 'winid=\n' in command_body('/tagexec', b'echo winid=$winid\n') # A second --detach of a name a live session holds: said, exit 1, # no Zig error trace. second_env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_')} |
