summaryrefslogtreecommitdiff
path: root/test/fs.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs.py')
-rw-r--r--test/fs.py18
1 files changed, 18 insertions, 0 deletions
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_')}