diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 09:32:02 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 0ee8d748c028ad5257f95e15db38646aecd2851b (patch) | |
| tree | 48b34e5604cd55f64bd9b323fdb9a2a6d0d60588 /test/fs.py | |
| parent | cc5323772d5acd07376c561e8e08eaf365b7d22c (diff) | |
| download | pardes-0ee8d748c028ad5257f95e15db38646aecd2851b.tar.gz pardes-0ee8d748c028ad5257f95e15db38646aecd2851b.zip | |
A root focus file names the pane with the keyboard and moves it; a pane's ctl says whether it is current
Scripts had no way to ask which pane has the keyboard or to give it one.
rio answers both through a window's wctl: its read ends with current or
notcurrent, and a write of current takes the keyboard (rio(4)). A pane's
ctl line now ends the same way, and since there is one keyboard for the
whole tree, /focus reads the focused pane's serial and takes a serial to
move the keyboard there, off any header that had it; a serial no pane has
fails with "no such window". fs-bench's stale readdir check is fixed too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/fs.py')
| -rw-r--r-- | test/fs.py | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -234,6 +234,17 @@ def discovery(binary, embedded=False): assert locked, 'a lock waiting on another open goes once it unlocks' client.close(mine) other.close(theirs) + # /focus names the pane with the keyboard and moves it, as rio's + # wctl `current` does; a pane's ctl line ends saying which it is. + client.write('/focus', f'{first}\n'.encode()) + assert client.read('/focus') == f'{first}\n'.encode() + assert client.read(f'/pane/{first}/ctl').endswith(b' current ') + assert client.read(f'/pane/{second}/ctl').endswith(b' notcurrent ') + try: + client.write('/focus', b'99999\n') + raise AssertionError('focus took a serial no pane has') + except OSError as refused: + assert 'no such window' in str(refused), refused assert set(client.list('/pane')) == {'new', str(fixture), str(first), str(second)} client.write(f'/pane/{first}/body', b'first pane', truncate=True) assert client.read(f'/pane/{first}/body') == b'first pane' @@ -304,7 +315,7 @@ def discovery(binary, embedded=False): assert client.read('/src/pardes.zig').startswith(b'const std') assert client.stat('/src/pardes.zig')['mode'] == 0o444 assert b'pub const Pardes' in client.read(f'/pane/{look(client, "/virtual/src/pardes.zig")}/body') - print('9P discovery: listing/stat/find are inert; new, remove, look, exec, name, sel, log and ctl lock behave') + print('9P discovery: listing/stat/find are inert; new, remove, look, exec, name, sel, log, ctl lock and focus behave') def run_file(binary): |
