Open a WSL session
wsl_connectOpen a session in the configured WSL distro and return its session ID, preserving the working directory across subsequent shell commands. Close it when done.
Instructions
Open a session in the configured distro and return its session id. A session remembers the working directory, so a 'cd' in one wsl_exec still applies to the next. Each command is still its own process — nothing else (environment variables, background jobs) persists between calls. Close it with wsl_disconnect when done; idle sessions are forgotten automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute directory to start in, with no shell metacharacters. Defaults to WSL_CWD, else the login shell's directory. |