Expand description
WSL terminals (P1 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md).
A WSL pane is wsl.exe -d <distro> in a ConPTY: no network, no helper, no
durability (the distro’s shell lives as long as its VM, spec §3.3 and §5.5).
Structs§
- WslLaunch
- What
wsl.exeneeds to start a pane’s process in a distro.
Constants§
- AGENT_
IDENTITY_ ENV - The agent identity a process started for an agent carries, set by the
server from the agent’s definition (
spawn_env::identity), not by its caller. Listed inWSLENVwhen present, so a command run in a distro for an agent names it as one run on Windows does.GH_CONFIG_DIRcrosses too, path-translated, aswslenv_withadds it. - FORWARDED_
ENV - Environment variables a WSL shell should see from the Windows side. WSL does
not pass the Windows environment through;
WSLENVlists what crosses. Never the local URL or auth key: those name this machine’s srv, which a shell in the distro has no business calling without the user knowing.
Functions§
- launch
- The
wsl.exearguments for a pane: an interactive login shell, or the pane’s command run by the distro’ssh.cwdis a path inside the distro; empty means the user’s home. - list
- The installed distributions, or none (not Windows, no WSL, or no distro).
- list_
cached list, kept for [LIST_CACHE_TTL]: for the places in the Files pane and the editor tree show each time they open, so a slowwsl.execosts at most one wait per half minute. A connection check useslist, so a distro installed a moment ago is found there.- wslenv
WSLENVwithFORWARDED_ENVadded to whatever the user already set, without duplicates.- wslenv_
with WSLENVfor a process in a distro: the terminal variables, the names its caller set (an agentShellcall’senv, or a pane’s configuredcmd:env), andGH_CONFIG_DIRtranslated to a distro path (/p), so an agent’s plain-ghguard holds inside the distro too andghthere cannot act as the user. Never anAGENTMUX_*variable beyond the terminal ones and the agent id and slug: the auth key, the local URL and the jekt key stay on Windows.