Answer stability round 2: 0 🔴, 2 🟡 (0 misread); a window is handed an XDG variable its starter lacks as empty, and a test pins the plan check under XDG_CONFIG_HOME
CI / tests (pull_request) Successful in 5m30s
CI / tests (pull_request) Successful in 5m30s
This commit is contained in:
@@ -20,10 +20,11 @@ CHUNK_FLAG = "--chunk"
|
||||
OWN = "BUILD_RELEASE_"
|
||||
|
||||
|
||||
# A window gets the tmux server's environment, not the starting terminal's. Without the two XDG variables, a window would lock and write in other folders than the entry point that started it.
|
||||
# A window gets the tmux server's environment, not the starting terminal's. With another XDG value than its starter's, a window would lock and write in other folders. So each is handed even where the starter lacks it, as empty: an empty value moves no folder.
|
||||
def handed(env: typing.Mapping[str, str]) -> dict[str, str]:
|
||||
"""The variables of env that an entry point hands each window it starts: those both entry points read, and the two that move the config folder and the state folder."""
|
||||
return {name: value for name, value in env.items() if name.startswith(OWN) or name in (XDG_CONFIG_HOME, XDG_STATE_HOME)}
|
||||
"""The variables an entry point hands each window it starts: those of env that both entry points read, and the two that move the config folder and the state folder."""
|
||||
own = {name: value for name, value in env.items() if name.startswith(OWN)}
|
||||
return {**own, XDG_CONFIG_HOME: env.get(XDG_CONFIG_HOME, ""), XDG_STATE_HOME: env.get(XDG_STATE_HOME, "")}
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
||||
Reference in New Issue
Block a user