From 48c129a701d60abdb836bbb400d949cc61ed2820 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 23:32:31 -0300 Subject: 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 --- test/fs.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index 0821b117..23647b45 100644 --- a/test/fs.py +++ b/test/fs.py @@ -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_')} -- cgit v1.3