diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-21 17:31:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-22 02:33:28 -0300 |
| commit | 245dd088a5b502c72f94c85bf1cc5bd0ba7ebb56 (patch) | |
| tree | 8772fea20505fb9d5a959bcf2fc646a81c614994 /test/daemon.py | |
| parent | 242095c9e7e2eca11af92b9a0d563d640cfa65f2 (diff) | |
| download | pardes-245dd088a5b502c72f94c85bf1cc5bd0ba7ebb56.tar.gz pardes-245dd088a5b502c72f94c85bf1cc5bd0ba7ebb56.zip | |
terminals: every client's terminals by the pty's bytes, the one road (the user's ruling of 2026-11-22: "just start the structural fix"): a session's units carry its ptys' bytes and each client feeds its own emulator in the tape's order (`Peers.bytes`, set by runtime/session.zig unless PARDES_TERM_SCREEN, a working name for the way back until screen state's road is deleted), and the welcome says the road (wire 29: one byte before `blobs`; test/daemon.py `WIRE`), which a client loads its dump on BEFORE its digest check (`fromDump`, join's and confirmBoot's one load, written twice before, and `road`): the pair's switch (`zwrkukrx`, duplicated here) checked a client's dump on screen state and turned it after, so under bytes every `pardes --attach` to a session with a terminal was refused as "loaded as another session" (daemon.py:544 client C, a far client's first frame never drawn); the pair's own boot takes the road from its environment (its session is its child) and the welcome confirms it; the predicted echo stays on the one road: echo.zig's overlay was already drawn over the frame, only its arming (gated on screen state) and its retirement (a delta's version) were the old road's: armed whenever a replica has an echo, retired at each confirmed unit that fed a terminal (`Echo.fed`, the grid's active top), echo.zig's tests run on the bytes road (17/17 under the filter); the pump-lag test (a session's own step reading a terminal right after its output, in one pump, through `Peers`) passes here: there is no flush to be behind; test/process.zig and test/daemon.py keep PARDES_TERM_SCREEN (`KEEP`) for the way back's row; measured against screen state (reports/pardes-term-join-7.md, its table): typing at a far prompt 16 KB against 22 KB, a full-screen program 80 KB against 103 KB, a 1 MiB `cat` through 1 Mbit 607 KB and 5.2 s with one 2.2 s rejoin against 27 KB and 0.4 s, the echo predicted on both (10 ms at 200 ms RTT, 222 ms unpredicted); gated: core-test 904/1068, shell-test 1110/1113, term-test 19/19, process-test 0 of 145 and as pairs 0 of 145, the bytes soak 3 of 3 clean, daemon.py every mode on Debug and ReleaseSafe (--restore the base's), --upgrade from the installed build 3 of 3 and between the two builds both ways, --far whole 7 of 7 on ReleaseSafe, the frame and perf gate against tree3 PASS (77/77, corpus2x -0.053%, 121 counts within 0.1%, client cells within +0.045%), the cross-builds
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/daemon.py')
| -rw-r--r-- | test/daemon.py | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/test/daemon.py b/test/daemon.py index e334b6e8..2e666ad1 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -69,6 +69,11 @@ from pathlib import Path sys.path.insert(0, str(Path(__file__).parent)) from ninep import Client # noqa: E402 +# The caller's PARDES_* is dropped (a session of the user's), these kept: a +# road for every session the run starts (PARDES_TERM_SCREEN: its terminals to +# its clients as screen state, the way back). +KEEP = ('PARDES_TERM_SCREEN',) + def wait_for(what, check, timeout=10): deadline = time.monotonic() + timeout @@ -258,7 +263,7 @@ class Replica: """A replica's connection (abi/wire.zig): length-prefixed messages, a tag byte and a little-endian u32 length. It is a near client: its first word after the hello says so.""" - WIRE = 28 + WIRE = 29 def __init__(self, path, timeout=10): self.path, self.timeout = path, timeout @@ -436,7 +441,7 @@ def clients(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rc-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -578,7 +583,7 @@ def launch(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rl-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -646,7 +651,7 @@ def pair(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rp-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1', PARDES_PAIR='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -720,7 +725,7 @@ def pair_rows(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rq-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1', PARDES_PAIR='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -910,7 +915,7 @@ def attach_upgrading(binary, rounds=6, dump=True): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='ru-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1001,7 +1006,7 @@ def kept_views(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rk-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1059,7 +1064,7 @@ def pair_upgrade_views(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rv-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1', PARDES_PAIR='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1165,7 +1170,7 @@ def pair_exec_reaps(old, new): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rpx-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1', PARDES_PAIR='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1229,7 +1234,7 @@ def far_exec(old, new): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rfx-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1295,7 +1300,7 @@ def pair_window_geometry(gui_binary, new_gui): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rgg-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), SHELL='/bin/bash', PARDES_NOTIME='1', PARDES_DAEMON='on', TERM='xterm-256color', PARDES_PAIR='1', SDL_VIDEO_DRIVER='offscreen') @@ -1367,7 +1372,7 @@ def manage(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rm-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1471,7 +1476,7 @@ def relink(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rr-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1577,7 +1582,7 @@ def answer_late(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='ra-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1695,7 +1700,7 @@ def pdf_window(binary, gui_binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='pdfw-', dir=os.environ.get('TMPDIR') or scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') env.pop('XDG_DATA_HOME', None) @@ -1761,7 +1766,7 @@ def window_clients(binary, gui_binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='wc-', dir=os.environ.get('TMPDIR') or scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -1983,7 +1988,7 @@ def far(binary): scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rf-', dir=scratch)) cache = root / 'cache' - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), XDG_CACHE_HOME=str(cache), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1', PARDES_REPLICA_FAR='1') @@ -2150,7 +2155,7 @@ def far_flood(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='fl-', dir=os.environ.get('TMPDIR') or scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), XDG_CACHE_HOME=str(root / 'cache'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') @@ -2225,7 +2230,7 @@ def by_hash(binary): scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rh-', dir=scratch)) cache = root / 'cache' - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), XDG_CACHE_HOME=str(cache), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -2311,7 +2316,7 @@ def games(binary, libs, secs=10): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rg-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), XDG_DATA_HOME=str(root / 'data'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -2422,7 +2427,7 @@ def far_find(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rq-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), XDG_DATA_HOME=str(root / 'data'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1', PARDES_REPLICA_FAR='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -2489,7 +2494,7 @@ def restore_client(binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rr-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), XDG_DATA_HOME=str(root / 'data'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -2623,7 +2628,7 @@ def kitty_image(binary, secs=5): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='ri-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -2684,7 +2689,7 @@ def main(binary, cycles): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rt-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -2918,7 +2923,7 @@ def gui(binary, cycles): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rtg-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} (root / 'caps').mkdir() env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), SHELL='/bin/bash', PARDES_NOTIME='1', PARDES_TEST='1', PARDES_TEST_CAPTURE_DIR=str(root / 'caps'), @@ -3013,7 +3018,7 @@ def gui_pair(gui_binary): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rgp-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), SHELL='/bin/bash', PARDES_NOTIME='1', PARDES_DAEMON='on', TERM='xterm-256color', PARDES_PAIR='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -3184,7 +3189,7 @@ def upgrades(old, new): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='rtu-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -3493,7 +3498,7 @@ def upgrade_clients(old, new): scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='ruc-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') (root / 'config' / 'pardes').mkdir(parents=True) @@ -3595,7 +3600,7 @@ def gui_upgrades(old, new): another build.""" scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' root = Path(tempfile.mkdtemp(prefix='rtgu-', dir=scratch)) - env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env = {k: v for k, v in os.environ.items() if (not k.startswith('PARDES_') or k in KEEP) and 'PAGER' not in k} display = Path(os.environ.get('WAYLAND_DISPLAY', 'wayland-0')) if not display.is_absolute(): display = Path(os.environ.get('XDG_RUNTIME_DIR', f'/run/user/{os.getuid()}')) / display |
