From 9ac223e5436a9f5831c97382270dedbf9f13277d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 04:00:33 -0300 Subject: --wait waits on the pane its look answered, read on the look's own open, not one found again by name in /index The forwarded look was a write and nothing more, and --wait then looked its file up in /index. /index shows names escaped (`\\` for a backslash, `\xNN`), so a file named with one matched no pane and --wait exited 0 at once, as if the pane were already closed. The look is now asked on one open (Client.ask) and its answer is the pane waited on; /index by name stays only for a look that answers none. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index fcd779d1..483ef320 100644 --- a/test/fs.py +++ b/test/fs.py @@ -1395,6 +1395,22 @@ def test(binary, quic=False): assert time.monotonic() - deleted < .05, time.monotonic() - deleted assert second.wait(timeout=5) == 0 assert edited.read_bytes() == b'edited\n' + # --wait waits on the pane its look answered, on the look's own + # open: a name /index shows escaped (a backslash is `\\` there) + # is still the pane waited on, not one already gone. + odd = root / 'wait\\odd.txt' + odd.write_bytes(b'odd\n') + before = serials() + waiting = subprocess.Popen([binary, '--wait', str(odd)], cwd=root, env=env, + stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + deadline = time.monotonic() + 3 + while not serials() - before and time.monotonic() < deadline: + time.sleep(.01) + odd_pane, = serials() - before + time.sleep(.5) + assert waiting.poll() is None, waiting.stderr.read() + client.remove(f'/pane/{odd_pane}') + assert waiting.wait(timeout=5) == 0 # A name not there yet opens a pane named it, as acme's B does, # and Save creates it: git's and fish's temporary files are. fresh = root / 'wait new.txt' -- cgit v1.3